-
-
Save blizzrdof77/9ac97b0536b9e1a8abbf3fd05355c3d0 to your computer and use it in GitHub Desktop.
Javascript convert camelcase to dash (hyphen)
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
/** | |
* Convert camelCase string to lowercase string with dashes (pretty permalink style ;-) | |
* | |
* @return String | |
*/ | |
String.prototype.camelCaseToDashed = function() { | |
return this.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment