JavaScript Удалить пространство из строки
const removeSpaces = str => str.replace(/\s/g, '');
// Example
removeSpaces('hel lo wor ld'); // 'helloworld'
Batman
const removeSpaces = str => str.replace(/\s/g, '');
// Example
removeSpaces('hel lo wor ld'); // 'helloworld'
str.replaceAll(/\s/g,'')
.replace(/ /g,'')
var str = " Hello World! ";
alert(str.trim());
const greeting = ' Hello world! ';
console.log(greeting);
// expected output: " Hello world! ";
console.log(greeting.trim());
//your boy siddhesh Kuakde