📜  转义 JSON 无效字符列表中的特殊字符以从 JSON 字符串中删除 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:52.762000             🧑  作者: Mango

代码示例1
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.