Jonas Cristens Jonas Cristens - 29 days ago 21
JSON Question

Automatically remove quotes in JSON string Java

I extract data from a website in JSON format. When I try to parse a JSON with quotes in the body it gives me the following error.

org.codehaus.jettison.json.JSONException:


Does anybody know how I can automatically remove the quotes (the quotes around "Equity Put") in the string without removing the other quotes (like in "body").

In this example in the string of the body field the " in "Equity Put" gives the error.

{"body":"ChOTD-11/3/16 CBOE "Equity Put":Call Ratio / ISEE Call:Put Ratio Hits Extreme > 1.00 $SPY $SPX"}

Answer

"Equity Put" should have been \"Equity Put\". Those quotes should have been what is called escaped, or otherwise, the string ends right before the word Equity.

Comments