I have some object with map data and I need to convert it to JSON. I am using JSON.stringify() method, but after conversion I am getting next result:
{"someval":1,"someval2":"blabla","my_map":["{\"email\":\"[email protected]\",\"fullName\":\"username\"}"],"moredata":""}
I need to get clear string for my_map
, without extra '\' characters. How I can remove them? Just replace doesn't works because other values can have such characters.
my_map
should simply be an array containing an object, not a string. But if you really want it to be a string then the inner”
have to be escaped. There is no way around it.