如何将下面的字符串转成xml?
var query = @"<Cars><Car manufacturer='lindo'/>
<Car manufacturer='Opera'/></Cars>";
因为它是一个字符串,所以我无法应用扩展方法 .cast() 将其转换为 XDocument 或 XElement。
最佳答案
使用 XDocument.Parse方法。
关于c# - 字符串到Xml的转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1955318/