Удалить пространства в струне JS
str.replace(/\s+/g, '')
Dangerous Duck
str.replace(/\s+/g, '')
var spacesString= "Do I have spaces?";
var noSpacesString= myString.replace(/ /g,'');// "DoIhavespaces?"
var str = " Some text ";
str.trim();
"hello world".replace(/\s/g, "");
.replace(/ /g,'')
removing white spaces