注意不能用正则表达式. 使用的知识点只能是js的语法范围.
先谢过了
例如:
Input: “We have 30 apples will be handed out to 10 students who need it, containing 5 foreigners ”.
Output: 30 + 10 + 5 = 45
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
typeof arr[i] === number
把字符串挨着扫描一遍不就完了……
var str = 'We have 30 apples will be handed out to 10 students who need it, containing 5 foreigners';