0

My target is to generate such json string: {"EndTime": "\/Date(1309737600000)\/"}

I define a HashMap to generate the string

If I define the string value as "\\/Date(1317375052044)\\/" then the result is "\\\\/Date(1317375052044)\\\\/".

If I define the string as "/Date(1317375052044)/" then the result is "/Date(1317375052044)/".

How I can generate the result "\/Date(1309737600000)\/"?

Xilang
  • 1,513
  • 3
  • 18
  • 36

1 Answers1

0

Duplicated from How should I escape strings in JSON? . Following this response try defining the string as "\\\\/Date(1317375052044)\\\\/" because in Java String '\' is also a escape character!

Community
  • 1
  • 1
Zecas
  • 647
  • 4
  • 23