Skip to content

Instantly share code, notes, and snippets.

@daGrevis
Created March 8, 2012 10:05
Show Gist options
  • Select an option

  • Save daGrevis/2000086 to your computer and use it in GitHub Desktop.

Select an option

Save daGrevis/2000086 to your computer and use it in GitHub Desktop.
i18n helper
function a(b) {
c =
b
.toLowerCase()
.split(' ')
.join('-')
.replace(/[^A-Za-z-]+/, '');
console.log(c);
}
@daGrevis

daGrevis commented Mar 8, 2012

Copy link
Copy Markdown
Author

Just open JavaScript console and paste this script in. Then...

Input:

a('For additional information please contact..............')

Output:

for-additional-information-please-contact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment