Created
March 8, 2012 10:05
-
-
Save daGrevis/2000086 to your computer and use it in GitHub Desktop.
i18n helper
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
| function a(b) { | |
| c = | |
| b | |
| .toLowerCase() | |
| .split(' ') | |
| .join('-') | |
| .replace(/[^A-Za-z-]+/, ''); | |
| console.log(c); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just open JavaScript console and paste this script in. Then...
Input:
a('For additional information please contact..............')Output:
for-additional-information-please-contact