I use org.json to parse and write json. When serialized, i.e. When converting to a string, I see that the json object adds an extra escape character. How can this be avoided if possible?
String jsonStr = "{\"AD\":\"</p>\"}"; JSONObject jsonObject = new JSONObject(jsonStr); System.out.println(jsonStr); System.out.println(jsonObject.toString());
Output:
{"AD":"</p>"} {"AD":"<\/p>"}
source share