Created
April 26, 2022 17:44
-
-
Save sergioccrr/2d6e8b568f98f988474d12dc9e1d5d2b to your computer and use it in GitHub Desktop.
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
String.prototype.cleanSpaces = function(str) { | |
if (!str) { | |
str = this; | |
} | |
return str.replace(/\s+/g, ' ').trim(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment