Handling escape characters in JSON response in C#

前端 未结 2 1232
说谎
说谎 2021-01-27 19:36

I have a rather simple issue that for some reason I can find a help for using SO and Google. I am receiving a JSON reply that looks like this:

\"{
\\\"data\\\":          


        
2条回答
  •  醉话见心
    2021-01-27 20:31

    You're trying to escape the \ character twice using regular escaping ("\\") and verbatim strings (@"string"). Try

    sContent = Regex.Replace(sContent, @"\", "");
    

提交回复
热议问题