CSharp examples for System.Xml:XML String
Decodes the XML escape sequences into normal string
using System.Linq; using System.Text; using System.Collections.Generic; using System.Globalization; using System.Xml.Linq; using System;/* ww w .j a v a 2 s . c o m*/ public class Main{ /// <summary> /// Decodes the XML escape sequences into normal string /// </summary> /// <param name="str">The string to decode.</param> /// <returns></returns> public static string DecodeXMLString(string str) { if (str.IndexOf('&') >= 0) { return str.Replace("<", "<").Replace(">", ">").Replace(""", "\"").Replace("'", "'").Replace("&", "&"); // Make sure that & is the final replace so that sequences such as &gt; do not get corrupted } return str; } }