<script>
var str = "background-color";
var pattern = /-[a-z]/ig;
alert(str.replace(pattern,function(all,letter){
return letter.toUpperCase;
}));
</script>
转驼峰
最新推荐文章于 2024-06-05 18:04:59 发布
<script>
var str = "background-color";
var pattern = /-[a-z]/ig;
alert(str.replace(pattern,function(all,letter){
return letter.toUpperCase;
}));
</script>