Answers for "Escaping special characters in JSON / list of invalid characters to strip from JSON string"

0

Escaping special characters in JSON / list of invalid characters to strip from JSON string

A JSON string must be double-quoted, according to the specs, so you don't need to escape '.
If you have to use special character in your JSON string, you can escape it using \ character.

See this list of special character used in JSON :

\b  Backspace (ascii code 08)
\f  Form feed (ascii code 0C)
\n  New line
\r  Carriage return
\t  Tab
\"  Double quote
\\  Backslash character

For new readers, always use a double quotes for your json strings.
Posted by: Guest on May-06-2021

Code answers related to "Escaping special characters in JSON / list of invalid characters to strip from JSON string"

Browse Popular Code Answers by Language