Code: Select all
public int lowerCaseCount(String string){
int pivot = 0, sum = 0;
while (true){
try{
if(Character.isLowerCase(string.charAt(pivot))){
sum ++;
}
pivot++;
}catch (StringIndexOutOfBoundsException e) {
return sum;
}
}
}