I have an json object in the form
{
"name" : "ok", "country" : "US","phone" : "900",
"email" : "[email protected]", "time" : "21:00"
}
and I want to convert it into a string which should look like the below example:
"{\n \"name\": \"ok\",\n \"country\": \"US\",\n \"phone\": \"900\",\n \"email\": \"[email protected]\",\n \"time\": \"21:00\",\n \"sendData\": \"300\"\n }"
I tried using JSON.stringify(); but it didn't give the desired output. Is there a easy way to achieve it. Please help me.