I have this json data.I want to parse it.I am getting error when I am trying to do
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.
The result will look like this:
{
"id": "11",
"note": "A sample note"
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.