I want to end whileloop, regardless of the length. For python a (-1) is returned when the index exceeds the length of the string. But I can't find to work out how to do the same in java.
while(true) {
System.out.println("Letter nur " + (i+1) + " is " + name.charAt(i));
if(name.charAt(i)==-1){
break
}
i = i + 1;
Can I and if yes, how?