Lesson 22 of 34
String Problems: Reverse, Palindrome, Count
10 min 30 XP
Loop over a String character by character with charAt(i) or toCharArray(). Reversing, palindromes and counting vowels are campus-interview favourites.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.Character.isDigit(ch), Character.isLetter(ch) and Character.isUpperCase(ch) tell you what kind of character you have.