输出一个字符串中首先出现三次的英文字符(排除数字影响但是不能排除空格影响)
import java.util.Arrays;
public class Test {
public void threeTimesWords(String str){
char[] arr=str.toCharArray();
System.out.println(Arrays.toString(arr));
a:for (int i = 0; i <arr.length ; i++) {
int temp=0;
for (int j = i; j <arr.length ; j++) {
if(arr[j]==arr[i]){
temp++;
if(temp==3){
if (!Character.isDigit(str.charAt(i))){
System.out.println(arr[i]);
break a;
}
}
}
}
}
}
public static void main(String[] args) {
Test test = new Test();
test.threeTimesWords("333 hello hello hello");
}
}