javascript remove all whitespaces
snippet in javascript

javascript remove all whitespaces

user2339

var spacesString= "Do I have spaces?"; 
var noSpacesString= myString.replace(/ /g,'');// "DoIhavespaces?"