dimanche 28 juin 2015

Replace all occurrence of pattern in a string

I have a string that needs that look like this:

{"myObject":"{ \"timestamp\" : \"123\" , \"data\" : {\"description\": \"sample\" , \"number\": \"123\"}

What I need to do is to replace all \" with " only. What is the regex for this?

I have tried inputString.replace(/\\"/g, '"'); but its not working

Aucun commentaire:

Enregistrer un commentaire