Skip to content

Instantly share code, notes, and snippets.

@ZoolWay
Created May 17, 2016 09:16
Show Gist options
  • Save ZoolWay/3a6ed3b5f8c6ddf0a77b112f22821d17 to your computer and use it in GitHub Desktop.
Save ZoolWay/3a6ed3b5f8c6ddf0a77b112f22821d17 to your computer and use it in GitHub Desktop.
TypeScript variant of camelize.js
private static camelize(s: string): string {
return s.replace(/(?:^|[-_])(\w)/g, function (stripped, letter) {
return letter ? letter.toUpperCase () : '';
}).replace(/(^\w)/, function(letter) { return letter.toLowerCase()});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment