var string = 'list-style-position', result = string.replace(/-(\w)/g, function(o, o1){return o1.toUpperCase()}); alert(result);