Let say i have this code:
XmlNode counsel = doc.CreateElement("COUNSELS");
XmlNode p = doc.CreateElement("p");
counsel.AppendChild(p);
XmlNode b = doc.CreateElement("b");
p.AppendChild(b);
b.InnerText = "Counsel:";
and it will output:
<COUNSELS>
<p>
<b>Counsel:</b>
</p>
</COUNSELS>
what can i do to achieve this:
<COUNSELS>
<p><b>Counsel:</b></p>
</COUNSELS>
correct me if i made any mistake on writing this post.
Since the OP comfirms regex replace is acceptable. I can use two simple replaces.
output
You can follow the pattern to replace space around other tags, or use more advanced single time replace, all depend on your actual requirement and skills.