Remove '\' char from string c#

后端 未结 10 1067
谎友^
谎友^ 2020-12-15 03:16

I have the following code

string line = \"\"; 

while ((line = stringReader.ReadLine()) != null)
{
    // split the lines
    for (int c = 0; c < line.Len         


        
10条回答
  •  情话喂你
    2020-12-15 03:45

    I have faced this issue so many times and I was surprised that many of these don't work.

    I simply deserialize the string with Newtonsoft.Json and I get cleartext.

    string rough = "\"call 12\"";
    rough = JsonConvert.DeserializeObject(rough);
    
    //the result is: "call 12";
    

提交回复
热议问题