题解 | #在字符串中找出连续最长的数字串#
在字符串中找出连续最长的数字串
http://www.nowcoder.com/practice/2c81f88ecd5a4cc395b5308a99afbbec
let str; while(str = readline()){ let res = str.match(/\d+/g); let max = 0; for(let v of res){ if(v.length>max){ max = v.length; } } let resStr = '' for(let v of res){ if(v.length == max){ resStr +=v } } console.log(resStr+','+max) }