Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean containsAllVowels(String word) {
- String[] vowels = {"a", "e", "i", "o", "u", "y"};
- int vowelsContained = 0;
- for (String vowel : vowels) {
- if (word.contains(vowel)) {
- vowelsContained++;
- }
- }
- return vowelsContained == vowels.length;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement