Removing quotation marks in JSONObject
- by Spike Williams
I'm using the net.sf.json.JSONObject to create some data to be sent to a front end application, and I don't like the ways ts adding quotation marks to every field name.
For example:
myString = new JSONObject().put("JSON", "Hello, World!").toString();
produces the string {"JSON": "Hello, World"}.
What I want it to return is {JSON: "Hello, World"} - without quotes around "JSON". What do I have to do to make that happen?