Skip to content

Instantly share code, notes, and snippets.

@c01nd01r c01nd01r/index.js
Created Oct 21, 2017

Embed
What would you like to do?
Hyphenate a camelCase string. (Vue.js)
/**
* Hyphenate a camelCase string.
*/
var hyphenateRE = /\B([A-Z])/g;
var hyphenate = function(str) {
return str.replace(hyphenateRE, '-$1').toLowerCase()
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.