Skip to content

Instantly share code, notes, and snippets.

@Neoglyph
Created July 3, 2017 13:04
Show Gist options
  • Save Neoglyph/ec63eb6ac9a9ad9def35bc13af78f6e6 to your computer and use it in GitHub Desktop.
Save Neoglyph/ec63eb6ac9a9ad9def35bc13af78f6e6 to your computer and use it in GitHub Desktop.
Split camel case with dashes (-)
camelCase.replace(/([A-Z])/g, function (g) {
return "-" + g[0].toLowerCase();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment