I am supposed to read in a string, convert it to lowercase, then return the first character in the string. If the first character is not a string I'm supposed to print \0
.
I have tried:
String ch = sc.nextLine();
char c = ch.charAt(0);
if (Character.isLetter(c)) {
ch = ch.toLowerCase();
c = ch.charAt(0);
return c;
}
return '\0';