Created
May 1, 2016 04:18
-
-
Save arcdev1/ce408ec30714e2d71a7a9b3c32d41cc9 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
var s = "some_string_to_change", | |
len= s.length, | |
i, | |
upped = false; | |
result = ""; | |
for(i=0;i<len;i++) { | |
if(s[i] === "_") { | |
result += s[i+1].toUpperCase(); | |
upped = true; | |
} else if (upped === false) { | |
result += s[i]; | |
} else { | |
upped = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment