public class demo {
public static void main(String[] args) {
String str = "wewekljhiouiuuuuuuuuIUiijeeeeeeeeeeeeeeejsagg";
int temp = 1;
int rep = 1;
char strTemp = str.charAt(0);
char strRepeat = 0;
for (int j = 1; j < str.length(); j++) {
if (str.charAt(j) == strTemp) {
temp = temp + 1;
if (temp >= rep) {
rep = temp;
strRepeat = strTemp;
}
} else {
strTemp = str.charAt(j);
temp = 1;
}
}
System.out.println("strRepeat : " + strRepeat + " ;rep :" + rep);
}
}