Skip to content

Instantly share code, notes, and snippets.

@arcdev1
Created May 1, 2016 04:18
Show Gist options
  • Save arcdev1/ce408ec30714e2d71a7a9b3c32d41cc9 to your computer and use it in GitHub Desktop.
Save arcdev1/ce408ec30714e2d71a7a9b3c32d41cc9 to your computer and use it in GitHub Desktop.
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