我有一个JSON字符串是取代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"}]
意味着要被替换的符号是与\\
和""
与"[
和[
]"
与]
帮我如果posible。
以及在开始和结束我想删除“这个符号 –
@krishan什么是你的目标是什么呢? –
取代与“”和“[with [and]”with] –