我有这样一个字符串:"<Root><Child>Hey</Child></Root>"
如何将其转换为 XElement
对象?
最佳答案
使用XElement.Parse方法如下
XElement xmlTree = XElement.Parse("<Root><Child>Hey</Child></Root>");
Console.WriteLine(xmlTree);
关于c# - 如何从字符串转换为 XElement 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7847424/