Удалить пробел с помощью regex javascript
return str.replace(/\s/g, '');
fast_and_the_curious
return str.replace(/\s/g, '');
let hello = " Hello, World! ";
let wsRegex = /^\s+|\s+$/g;
let result = hello.replace(wsRegex, "");
myString.replace(/\s*/g,"")