regex ignore spaces javascript code example
Example 1: remove whitespace with regex javascript
return str.replace(/\s/g, '');
Example 2: regex space javascript
var str = "Is this all there is?";
var patt1 = /\s/g;
return str.replace(/\s/g, '');
var str = "Is this all there is?";
var patt1 = /\s/g;