My current code outputs only the first vowel it encounters. I'd like to know a way to output every vowel that is inputed once.
public static String vowels(String str) {
String vowels = "auioeëyAUIOEËY";
for(int i = 0;i < str.length();i++) {
for(int j = 0;j < str.length();j++) {
if(str.charAt(i) == vowels.charAt(j)) {
return "cointains " + vowels.charAt(j) ;
}
}
}
return "none";
}