Answers for "replace space with new line string javascript"

5

js replace space

// replaces space with '_'
str = str.replace(/ /g, "_");
// or
str = str.split(' ').join('_');
Posted by: Guest on May-11-2021
0

javascript replace spaces with br

str = str.replace(/\s/g, "<br>");
Posted by: Guest on November-16-2020

Code answers related to "replace space with new line string javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language