Answers for "how to remove \n\r from string node js"

2

javascript replace \n

var r = "I\nam\nhere";
var s = r.replace(/\n/g,' ');
Posted by: Guest on June-24-2020
0

javascript replace <br> with n

var str = $("#mydiv").html();
var regex = /<br\s*[\/]?>/gi;
$("#mydiv").html(str.replace(regex, "\n"));
Posted by: Guest on July-29-2020

Code answers related to "how to remove \n\r from string node js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language