I have an XML document from which I want to remove white spaces and carriage returns. How can I get the modified XML using C#.
Set the preserveWhitespace flag to false:
XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = false; doc.Load("foo.xml"); // doc.InnerXml contains no spaces or returns
1.4m articles
1.4m replys
5 comments
57.0k users