I am trying to deserialize a JSON string for an iOS app that I am writing. However, my app keeps getting hung up on the “\” escape sequence for double-quotes in the feed I am trying to read. What is a quick way to strip out that sequence so I can parse the feed correctly? (The feed is coming from my Django application on the server-side.)
Here is my json string:
[{\"pk\": 4161, \"model\": \"news.article\", \"fields\": {\"date_live\": \"2011-11-03 00:00:01\", \"date_added\": \"2011-11-03 03:10:59\", \"date_modified\": \"2011-11-03 03:10:59\", \"slug\": \"thursday-feature-backup-comic\", \"title\": \"THURSDAY FEATURE --> Backup Comic\"}}
You will notice that all of my “nodes” have the “\” escape sequence for the quote. Any ideas?
Thank you in advance for any help here.
L.
If you are trying to remove the escape inside python:
But if you want to remove the escape from javascript:
Note: You forgot a ] at the end of your string. At least I had an error when I’ve tryed to eval it. I put the ] at the end and eval worked.