答:
let str = 'A1B2C52';
let result = '';
for (let i = 0; i < str.length; i++) {
const charCode = str.charCodeAt(i);
if (charCode >= 48 && charCode <= 57) {
result += str[i];
} else {
if (result !== '') {
console.log(result);
result = '';
}
}
}
if (result !== '') {
console.log(result);
}