nodejs remove space from string code example
Example 1: javascript remove all spaces from string
str = str.replace(/\s/g, '');
Example 2: remove space from string javascript
var str = " Hello World! ";
alert(str.trim());
str = str.replace(/\s/g, '');
var str = " Hello World! ";
alert(str.trim());