Hello everyone, I'm hoping things are going well. I am currently working on removing newline and "\" characters from a string that I have after using JSON.stringify(). The string in question appears as follows:
"[{\n \"id_profile\": 1, \n \"name\": \"John\"\n \"id\" : \"894J45134R90FM\",\n...
So far, I have successfully removed "\n" with the help of .replace(/\r?\n|\r/g,' '), but I am facing difficulty when it comes to targeting the "\" character. My ultimate goal is to utilize parseJSON() in order to convert this into a JSON object for manipulation within the DOM.
Does anyone have any suggestions on how to structure the regex within replace? I believe the spaces should be tab delimited, given that this information is sourced from an Apiary API GET request. Should this be handled in a separate replace function?
Thank you in advance for any assistance provided.