Created
November 1, 2017 21:07
-
-
Save bcls/773df3412445776e8082aaf4b8725d2a to your computer and use it in GitHub Desktop.
remove spaces from a string #javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* remove spaces from a string | |
* @param {String} str string to process | |
* @return {String} trimmed string | |
*/ | |
function removeSpaces(str) { | |
str= str.replace(/\s/g, ''); | |
return str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment