Last active
September 27, 2017 20:56
-
-
Save bcls/8ee2e0fd7532584d814fa1d428e493a7 to your computer and use it in GitHub Desktop.
Remove spaces from a string #javascript
This file contains 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