I have a string, containing XML namespace, and I cant seem to remove this part
xmlns="http://www.rar.org/xyz/"
I've tried
return textWriter.ToString().Replace(@"xmlns="http://www.rar.org/xyz/"", "");
but this does not compile.
Answer
You need to escape the string. Since you are providing a verbatim string literal (by using the @), you need to use two quotes to escape it:
return textWriter.ToString().Replace(@"xmlns=""http://www.rar.org/xyz/""", "");
No comments:
Post a Comment