Skip to content

Instantly share code, notes, and snippets.

@chinghanho
Created February 22, 2014 14:20
Show Gist options
  • Save chinghanho/9155542 to your computer and use it in GitHub Desktop.
Save chinghanho/9155542 to your computer and use it in GitHub Desktop.
translate camelCase variant to hyphenated style
str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment