0

I get a JSON response, which I parse. Then populate in a POJO. Do some work on it and finally sysops json.toString instead of printing the content of the POJO. I am using json.toString() and in the response I get "currentTime":"08\/12\/2020 02:07:31 PM PDT" which is basically using \ for escaping / but for the final output I dont want this on the console. I can only use Json simple library.

Sonali Gupta
  • 494
  • 1
  • 5
  • 20
  • 1
    This is a [long-standing issue with the json-simple library](https://github.com/fangyidong/json-simple/issues/8). If you must use this library, and cannot tolerate the unnecessary backslashes, you'll need to fix the output yourself. Don't just blindly replace `\/` with `/` -- be sure to test inputs like `\\/` (which should be parsed as `\/`) – dnault Aug 12 '20 at 22:09

1 Answers1

0

Maybe try to replace those '/' with ' ' (space). Then you would have a reformatted string. ‍✌

Or replace it with whatever you just want.

p4czyk
  • 11
  • 3