请问下面的replace是如何按照大写字母分割字符串的
replace
function spinalCase(str) { str = str.replace(/([a-z])([A-Z])/g, '$1 $2'); console.log(str); } spinalCase('ThisIsSpinalTap');
'ThisIsSpinalTap'.replace(/([A-Z]{1}[a-z]*)/g,'$1 ')
1.4m articles
1.4m replys
5 comments
57.0k users