我有一个 json 字符串
我通过转换得到了这个字符串
var json = org.cometd.JSON.toJSON(envelope.messages);
"[{\"version\": \"1.0\", \"minimumVersion\": \"0.9\", \"channel\": \"/meta/handshake\", \"supportedConnectionTypes\": [\"long-polling\", \"callback-polling\"], \"advice\": {\"timeout\": 60000, \"interval\": 0}, \"id\": \"1\"}]"
我需要替换一些符号,我需要这样的输出
[{"version":"1.0","minimumVersion":"0.9","channel":"/meta/handshake","supportedConnectionTypes":["long-polling","callback-polling"],"advice":{"timeout":60000,"interval":0},"id":"1"}]
表示要替换的符号是 \\
with""
和 "[
with[
和 ]"
with]
如果可能,请帮助我。