replace space number at end of string javascript code example
Example: js replace space
// replaces space with '_'
str = str.replace(/ /g, "_");
// or
str = str.split(' ').join('_');
// replaces space with '_'
str = str.replace(/ /g, "_");
// or
str = str.split(' ').join('_');