Created
December 28, 2015 14:15
-
-
Save SeanJM/9075b03b6f0bc6f6093c to your computer and use it in GitHub Desktop.
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 jsCase(string) { | |
| return string.match(/[a-zA-Z0-9_]+/g).map(function (a, i) { | |
| if (i === 0) { | |
| return a.toLowerCase(); | |
| } | |
| return a[0].toUpperCase() + a.substr(1, a.length).toLowerCase(); | |
| }).join(''); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment