Answers for "convert a string to an xmldocument 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

Code answers related to "convert a string to an xmldocument c#"

C# Answers by Framework

Browse Popular Code Answers by Language