I have a string in the following format:
var abc = "{'ABC':'25117', 'data':'India\"NewDelhi\"'}"
My goal is to convert this string into a JSON object.
I have attempted to interchange ""
and ''
, but it did not work as expected.
When using the function JSON.parse(abc)
, it successfully works with the corrected string:
var abc = '{"ABC":"25117", "data":"India\'NewDelhi\'"}'
However, my strict requirement is to have "NewDelhi"
within double quotes i.e. ""
.