I\'m trying to do replace in JavaScript using:
r = \"I\\nam\\nhere\"; s = r.replace(\"\\n\",\" \");
But instead of giving me
.replace() needs the global match flag:
.replace()
s = r.replace(/\n/g, " ");