You need to sign in to do that
Don't have an account?

Jsonstring
Hi
How to remove \n,\ from a string?
"XYZ": "{\n \"Test\" : \"S\",\n \"SK\" : \"C\",\n \"DD\" : \"A\",\n \"AA\" : \"V\"\n}"
I am using json method to build the json request to post to the client server. But in json i am having the literals \n and \. This json request is not in the string format so i can not replace \n and \ with null value. How can i replace the \n and \ with null value (request should be in json format).
Thanks
Venkatsforce
Hi,
Try using replace and escape methods. Refer following links for examples:
http://stackoverflow.com/questions/4253367/how-to-escape-a-json-string-containing-newline-characters-using-javascript
https://code.google.com/p/json-simple/wiki/EscapingExamples