[英]Error in parsing json data
I have this json data.I want to parse it.I am getting error when I am trying to do 我有这个json数据。我想解析它。尝试执行时遇到错误
JsonObject json=new JsonObject(x);
Because it contains white spaces. 因为它包含空格。
{id=11, note=A sample note,}
Please help me to solve it. 请帮我解决。
To make your example a valid JSON wrap the properties and values in double quotes, remove the last comma and replace your equal sign with colon. 为了使示例成为有效的JSON,请将属性和值用双引号引起来,请删除最后一个逗号,并用冒号替换等号。
The result will look like this: 结果将如下所示:
{
"id": "11",
"note": "A sample note"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.