Skip to content

Instantly share code, notes, and snippets.

@rpbaltazar
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpbaltazar/c8b7d9cc3e4618143d2e to your computer and use it in GitHub Desktop.
Save rpbaltazar/c8b7d9cc3e4618143d2e to your computer and use it in GitHub Desktop.
<irony>Awesome nail to camel case a string</irony>
toCamelCase= (str) ->
val = _.map(str.split("_"), (x) ->
x[0].toUpperCase() + x.substr(1,1000)
).join("")
val[0].toLowerCase() + val.substr(1,1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment