I would imagine this is a multiple part situation with regex, but how would you split a camelcase string at the capital letters turning them in to lowercase letters, and the
Try something like:
var myStr = 'thisString'; myStr = myStr.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();