I try to read each char of "Mi4" if it is letter put it in variable "capital" if it is number put it in variable "num" there is no error, and NO output "
public static void main(String[] args) {
String capital = "";
int num = 1;
String sentence = "Mi4";
int senLength = sentence.length();
int i = 0;
while (i < senLength) {
String senStr = sentence.substring(i, i + 1);
char senChar = senStr.charAt(i);
if (senChar >= 'A' && senChar <= 'Z') {
capital = senStr;
} else if (senChar >= 'a' && senChar <= 'z') {
capital = capital + senStr;
} else if (senChar >= '2' && senChar <= '9') {
num = Integer.parseInt(senStr);
}
i++;
sentence = sentence.substring(i);
}
System.out.println(capital);
System.out.println(num);
}