replace slash with space in javascript code example
Example 1: javascript replace spaces with nbsp
str = str.replace(/\s/g, " ");
Example 2: javascript replace spaces with br
str = str.replace(/\s/g, "<br>");
str = str.replace(/\s/g, " ");
str = str.replace(/\s/g, "<br>");