0

I am trying to create a JSONObject which has two parameters, for example:

JSONObject jobj;    
jobj.put("data", {"hey":"hi"} ;

But the problem is as soon i create a JSONObject, it gets converted like this:

"data":"{\"hey\":\"hi\"}

My expectation is, I want it to look like this:

"data":{"hey":"hi"}

Also the second parameter is JSON as it random.

David Walschots
  • 12,279
  • 5
  • 36
  • 59
Nir
  • 5
  • 2
  • 1
    Duplicate of [https://stackoverflow.com/questions/13939925/remove-all-occurrences-of-from-string](https://stackoverflow.com/questions/13939925/remove-all-occurrences-of-from-string) – Sriram Jano Oct 03 '18 at 12:24
  • Hi Sriram , that is based on converting input String.But my input String is fine.Only after creating JSONObject it gets converted in that form. – Nir Oct 03 '18 at 12:37

1 Answers1

0

Replace all backslashes of json coverted string with empty value