FOLLOW US
4dots Software CODE BLOG

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
 

Please Donate!

Please Share!