how to remove string space in es6 code example
Example 1: js remove space from string
string.split(" ").join("")
Example 2: javascript remove space from string
const removeSpaces = str => str.replace(/\s/g, '');
// Example
removeSpaces('hel lo wor ld'); // 'helloworld'
Example 3: js remove space before string
var str = " Some text ";
str.trim();
// str = "Some text"