1var spacesString= "Do I have spaces?";
2var noSpacesString= myString.replace(/ /g,'');// "DoIhavespaces?"
1var string = " Hello World! "
2console.log(string);
3//" Hello World! "
4string2 = string.trim();
5console.log(string2);
6//"Hello World!"