Skip to main content

Practice · 3 of 5

Count with String.charAt

CHALLENGE
Difficulty: beginner+25 XP

Implement int countVowels(String s): how many of a/e/i/o/u appear (either case). Traverse with s.length() and s.charAt(i) inside a loop.

Back to lesson: Practice: Method toolkit