-
-
Save AliceWonderland/1279ba8047363c9dc9073e85581fe86a to your computer and use it in GitHub Desktop.
1.2 CamelCase created by smillaraaq - https://repl.it/GtLj/2
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
function undertocamel(undername) { | |
var camelCaseOutput = ""; | |
var foundUnder = false; | |
for(var i = 0; i<undername.length; i++) { | |
// undername[i]; | |
if (undername[i] === "_") { | |
foundUnder = true; | |
} else { | |
if (foundUnder) { | |
camelCaseOutput += undername[i].toUpperCase(); | |
foundUnder = false; | |
} else { | |
camelCaseOutput += undername[i]; | |
} | |
} | |
} | |
return camelCaseOutput; | |
} | |
undertocamel("apply_now"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment