更新时间:2022-11-14 16:08:13
匹配角色然后加入它们可能更明智:
It may be more sensible to match the characters and then join them:
str = str.match(/(\d+|[^\d]+)/g).join(',');
但是在定义字符串时不要省略引号:
But don't omit the quotes when you define the string:
var str = 'A123B234C456';