Created
November 8, 2015 14:44
-
-
Save buithehoa/97143369a9f652fa739d to your computer and use it in GitHub Desktop.
Replace all non-alphanumeric characters
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
"foo bar".downcase.gsub(/[^\p{Alnum}]/, '-') # Output: foo-bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment