题解 | #检查重复字符串#
检查重复字符串
https://www.nowcoder.com/practice/5ef31f11adf64d9fb18d74860e9ab873
function containsRepeatingLetter(str) { for(let i=0;i<str.length-1;i++){ console.log(str[i],str[i+1]) let reg=/[a-zA-Z]/ if(str[i]===str[i+1] && reg.test(str[i]) ){ return true } } return false }