Trying to find a way to stringify a JSON string, with escape characters like JavaScript.
For example --
Input:
{"name":"Error","message":"hello"}
Output:
"{\"name\":\"Error\",\"message\":\"hello\"}"
I am able to get the object as JSON String using Gson, but not stringify (with escape characters).
Is this possible with Java?