相关疑难解决方法(0)

从字符串C#中删除反斜杠

我有一些字符串,其中一些xml驻留.

字符串是:

string xmlRead = "<ns0:RequestedAmount xmlns:ns0=\"http://tempuri.org/XMLSchema.xsd\">  <ns0:RequestedAmount></ns0:RequestedAmount>  </ns0:RequestedAmount>" +
                         "<ns0:Response xmlns:ns0=\"http://tempuri.org/XMLSchema.xsd\">  <ns0:Response/> </ns0:Response>" +
                         "<ns0:isValid xmlns:ns0=\"http://tempuri.org/XMLSchema.xsd\">  <ns0:isValid/> </ns0:isValid>";
Run Code Online (Sandbox Code Playgroud)

我试过这个:

string s=xmlRead.Replace(@"\","");
string s=xmlRead.Replace("\"","");
string s=xmlRead.Replace(@"\",string.Empty);
Run Code Online (Sandbox Code Playgroud)

什么都没有帮助我帮助我在这里做错了什么.

c# string c#-4.0

0
推荐指数
1
解决办法
1072
查看次数

标签 统计

c# ×1

c#-4.0 ×1

string ×1