<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
let str = "1ty2yu34uhj342hj5671j34jiuhkk4hfhwr7483rfhuewbu23";
let arr = [];
let temp = "";
for(let i =0;i<str.length;i++){
if(!isNaN(parseInt(str[i]))){
temp += str[i]
}else{
if(temp){
arr.push(temp);
temp = "";
}
}
}
if(temp){
arr.push(temp);
temp = "";
}
console.log(arr);
</script>
</body>
</html>
20171211-number
最新推荐文章于 2020-02-14 08:40:49 发布