I am trying to replaces instances of \\r or \\n characters in my json object with for display on a website.
\\r
\\n
I tried:<
Try this:
myString = myString.replace(/[\r\n]/g, "");
Update: As told by Pointy on the comment below, this would replace a squence of \r\n with two , the correct regex should be:
\r\n
myString = myString.replace(/\r?\n/g, "");