Answer the question
In order to leave comments, you need to log in
How to cast json to string together with special characters?
Good afternoon!
I have a json object
For example with the following structure:
{
"value": "141401, Moscow region, Khimki, Kommunalny proezd, property No. 30, room 202",
"comment": "",
"type": "Address",
}
Now I need to write it (formed json) into one of the keys of another json , but in a string format that uses the special characters \n and backspace \r, as well as escaping quotes \"
I need to pass it with a string like:
"{ \r\n\"value\": \"141401, Moscow region, Khimki city, Kommunalny proezd, possession No. 30, room 202\",\r\n\"comment\": \"\",\r\ n\"type\": \"Address\"
Is there any proven way to do this by serializing the object to json using Newtonsoft
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question