0

when I put one in a objectJson it is adding escape characters automatically.

put the original

j.put("paif_start", "01/05/2012");

as it saves the put

{"paif_start":"01\/05\/2012"}

how to remove these escape characters?

Damon Abdiel
  • 3,045
  • 2
  • 17
  • 14

1 Answers1

0

On the receiving end, if you really want to, you could just do

 `myJsonString = myJsonString.replaceAll("\\","");`

But do note that those escape characters in no way make the JSON invalid or otherwise semantically different -- the '/' character can be optionally escaped with '\' in JSON.

Pratik Butani
  • 56,749
  • 54
  • 254
  • 407