CSharp examples for System.Xml:XML String
Encode Xml String
using System.Xml; using System.Text.RegularExpressions; using System.Text; using System.IO;/*from w w w . j a v a 2 s . com*/ using System.Globalization; using System; public class Main{ public static string EncodeXml(string xml) { return xml.Replace("&", "&").Replace("<", "<").Replace(">", ">").Replace("\"", """).Replace("'", "'"); } }