var string = 'font-size', match = string.match(/-(\w)/), result = string.replace(match[0], match[1].toUpperCase()); alert(result);