Created
August 5, 2014 17:11
-
-
Save ralucas/80b2f311d9550fa85d74 to your computer and use it in GitHub Desktop.
Useful regexes
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
// Take out multiple spaces and replace with single space | |
// i.e. "And the dog went on a walk" becomes "And the dog went on a walk" | |
string = string.replace(/\s{2,}/g, ' '); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment