With regex (i assume) or some other method, how can i convert things like:
marker-image or my-example-setting to markerImage o
marker-image
my-example-setting
markerImage
Try this:
var camelCased = myString.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
The regular expression will match the -i in marker-image and capture only the i. This is then uppercased in the callback function and replaced.
-i
i