I\'m fairly new to c# so that\'s why I\'m asking this here.
I am consuming a web service that returns a long string of XML values. Because this is a string all the attri
Both the string and the regex uses \ for escaping. The regex will see the character \ followed by ", and think it's a literal escape. Try this:
Regex rgx = new Regex("\\\\\"");
string strip = rgx.Replace(xmlSample, "\"");
You could also use raw strings (also known as veratim strings) in C#. They are prefixed with @, and all back-slashes are treated as normal characters. To include a quote in a raw string you need to double it.
Regex rgx = new Regex(@"\""")
string strip = rgx.Replace(xmlSample, @"""");