js replace space with plus code example
Example: js replace space with plus
// replaces space with '+'
str = str.replace(/ /g, "+");
// or
str = str.split(' ').join('+');
// replaces space with '+'
str = str.replace(/ /g, "+");
// or
str = str.split(' ').join('+');