D
D
Dima Avdoshin2020-10-21 23:39:17
JSON
Dima Avdoshin, 2020-10-21 23:39:17

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

1 answer(s)
R
Roman, 2020-10-22
@D1m0nd

https://stackoverflow.com/questions/323640/can-ic...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question