javascript replace \n
snippet in javascript

javascript replace \n

user6407

var r = "I\nam\nhere";
var s = r.replace(/\n/g,' ');