Answers for "clearing spaces in a string javascript"

22

remove spaces in a string js

str.replace(/\s+/g, '')
Posted by: Guest on April-29-2020
1

how to remove empty spaces befiore string js

const greeting = '   Hello world!   ';

console.log(greeting);
// expected output: "   Hello world!   ";

console.log(greeting.trim());
//your boy siddhesh Kuakde
Posted by: Guest on April-02-2021

Code answers related to "clearing spaces in a string javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language