c# replace \" characters

后端 未结 6 1427
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 20:39

I am sent an XML string that I\'m trying to parse via an XmlReader and I\'m trying to strip out the \\\" characters.

I\'ve tried

.Repla         


        
6条回答
  •  一整个雨季
    2020-12-29 21:02

    Try it like this:

    Replace("\\\"","");
    

    This will replace occurrences of \" with empty string.

    Ex:

    string t = "\\\"the dog is my friend\\\"";
    t = t.Replace("\\\"","");
    

    This will result in:

    the dog is my friend
    

提交回复
热议问题