Skip to content

Instantly share code, notes, and snippets.

@charliecm
Created April 22, 2014 19:47
Show Gist options
  • Save charliecm/11191983 to your computer and use it in GitHub Desktop.
Save charliecm/11191983 to your computer and use it in GitHub Desktop.
Converts hypen to camelCase in a variable name. From http://stackoverflow.com/questions/6660977/convert-hyphens-to-camel-case-camelcase
string.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment