zmm064
2/15/2019 - 1:22 PM

正则表达式

var str = "the-first-name";
console.log(str.replace(/-(\w)/g, function ($, $1) {
	return $1.toUpperCase();
})); // theFirstName


str = "100000000000";
console.log(str.replace(/(?=(000)+$)/g, ".")) // 100.000.000.000