0

Need help on matching multiple newline in xml file using Regular expression

I want to delete the multiple newline in an xml file content below

<pg>Data</pg>
<url>Data</url>
<pdate>Data</pdate>
<pdy>Data</pdy>
<pdm>Data</pdm>



<pdd>Data</pdd>
<dat>Data</dat>
<tom>Data</tom>
<des>Data</des>
<abs>Data</abs>
<geo>Data</geo>
<org>Data</org>
<per>Data</per>

Need help please!

1 Answers1

0

You can use PreserveWhitespace Property Check here

If PreserveWhitespace is true before Save is called, white space in the document is preserved in the output; otherwise, if this property is false, XmlDocument auto-indents the output.

XmlDocument doc = new XmlDocument();
    doc.PreserveWhitespace = false;
Suraj Singh
  • 4,041
  • 1
  • 21
  • 36