Created
April 6, 2017 04:32
-
-
Save anonymous/6a43e4694d446ab209b70b7184a2eb75 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