Answers for "convert xml string to file c#"

C#
1

string to xml c#

string test = "<body><head>test header</head></body>";

XmlDocument xmltest = new XmlDocument();
xmltest.LoadXml(test);

XmlNodeList elemlist = xmltest.GetElementsByTagName("head");

string result = elemlist[0].InnerXml; 

//result -> "test header"
Posted by: Guest on December-21-2020
0

convert xml string to file c#

File.WriteAllText("foo.xml", xml);
Posted by: Guest on April-29-2021

C# Answers by Framework

Browse Popular Code Answers by Language