print only vowels from a string java code example
Example: java program to print vowels in a string
String str = "hello";
String vowels = "aeiou";
for(char c : str) if(vowels.contains(c)) System.out.print(c + "");
String str = "hello";
String vowels = "aeiou";
for(char c : str) if(vowels.contains(c)) System.out.print(c + "");