softpcapps Software CODE HELP BLOG

Shareware and free Open Source Windows Software Applications and free Online Tools

How to XML Decode a String

To XML decode a string do the following :

		string text_to_decode="this is < a test < !";
		XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.LoadXml("<root1>" + text_to_decode + "</root1>");

        string decoded_text = xmlDoc.InnerText;

Please note that you have to also add "using System.XML;" on the top.

Download Demo Project

Encode Decode Demo Project