Answers for "how to remove a space from a word in javascript"

2

javascript remove space from string

const removeSpaces = str => str.replace(/\s/g, '');

// Example
removeSpaces('hel lo wor ld');      // 'helloworld'
Posted by: Guest on July-03-2020
1

how to erase spaces from a string javascript

str.replace(/\s+/g, '') //Replace str with variable name you have string saved too.
Posted by: Guest on July-31-2021

Code answers related to "how to remove a space from a word in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language