Answers for "trim only the whitespaces before & after a string js"

23

javascript remove all whitespaces

var spacesString= "Do I have spaces?"; 
var noSpacesString= myString.replace(/ /g,'');// "DoIhavespaces?"
Posted by: Guest on August-01-2019
0

remove whitespace with regex javascript

return str.replace(/\s/g, '');
Posted by: Guest on November-29-2020

Code answers related to "trim only the whitespaces before & after a string js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language