Answer the question
In order to leave comments, you need to log in
How to escape special characters from the received json array in C#?
What is the correct way to escape special characters from the text array (json) received from the server in C# so that the application does not crash when the parsed text is displayed on the screen?
If the text in JSon contains " ", etc. then the application crashes. So far, I have to cut out all the special symbols, but this solution does not suit me.
Answer the question
In order to leave comments, you need to log in
csharpindepth.com/Articles/General/Strings.aspx this should help.
In short, escape strings with the @ sign like this. It escapes all characters except double quotes. If there are significant double quotes in the text, then they need to be changed to two double quotes.
var text= @"Hello, ""mister""";
//Результат
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question