我正在使用Json通过JSON字符串进行解析。有些请求会返回如下内容:
{
"jsonResponse":[{
"id":"2",
"name":"Somename",
"title":"Json problem:"ErrorParsing"", //problem is here. with double quotations. how to remove them or remove error? When i delete brackets before and after ErrorParsing, it works good.
"otherinfo":"blabla",
}]
}
答案 0 :(得分:4)
那些不是括号;它们是(双)引号/引号。在有效的JSON中,字符串中的引号必须用\来转义,例如“你好\”世界\“”。
您正在使用的Web服务返回无效的JSON。
http://jsonlint.com是验证JSON字符串的有用资源。
答案 1 :(得分:1)
我认为你的意思是“双引号”,而不是“双括号”。你需要在那里使用不同的引号,例如:
"title":"Json problem:'ErrorParsing'"
答案 2 :(得分:0)
正确的json必须是
{
"jsonResponse":[{
"id":"2",
"name":"Somename",
"title":"Json problem:\"ErrorParsing\"", //problem is here. with double quotations. how to remove them or remove error? When i delete brackets before and after ErrorParsing, it works good.
"otherinfo":"blabla",
}]
}
我认为你明白了