I am having one interface which gives me one xml file.....in that xml file i am having many Blank Tags....like .....my problem is i want to remove that space coming in that blank tag.....i want this tag to be like ......i am getting same when i am opening that xml file in any browser but its not coming while i am opening it in notepad...please solve this issue as soon as possible...i wll be highly obliged to you all...
Thanx and Regards..
Ashu

VulpesPosted Mar 28, 2013, 8:25 AM
Can you tell from Intellisense when you type Regex.Replace whether the overload which takes 4 parameters is acceptable?
http://msdn.microsoft.com/en-us/library/taz3ak2f(v=vs.100).aspx
Ashu RawatPosted Mar 28, 2013, 2:00 AM
VulpesPosted Mar 27, 2013, 10:06 AM
http://msdn.microsoft.com/en-us/library/e7f5w83z(v=vs.100).aspx
What version of .NET are you using?
Ashu RawatPosted Mar 27, 2013, 5:31 AM
VulpesPosted Mar 26, 2013, 9:32 AM
using System.Text.RegularExpressions;
using System.IO;
// ....
string text = File.ReadAllText("ashu.xml");
string regExp = @"(<\S+)\s(/>)";
text = Regex.Replace(text, regExp, "$1$2");
File.WriteAllText("ashu.xml", text);