Created
February 22, 2014 14:20
-
-
Save chinghanho/9155542 to your computer and use it in GitHub Desktop.
translate camelCase variant to hyphenated style
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
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