How could I convert this to PascalCase and to camelCase? Answer A fully ES5 compatible way to do this is, to find all the dashes that are followed by an alphanumeric character using this simple regex /-w/g. Then just remove the dash and uppercase the character. The same can be done for pascal case just by also checking for the
Tag: camelcasing
Convert hyphens to camel case (camelCase)
With regex (i assume) or some other method, how can i convert things like: marker-image or my-example-setting to markerImage or myExampleSetting. I was thinking about just splitting by – then convert the index of that hypen +1 to uppercase. But it seems pretty dirty and was hoping for some help with regex that could make the code cleaner. No jQuery…