str.replaceAll(/s/g,'') .replace(/ /g,'')
const greeting = ' Hello world! '; console.log(greeting); // expected output: " Hello world! "; console.log(greeting.trim()); //your boy siddhesh Kuakde