hi everyone,
as title said all, i need actually to find a vowel(a,e,i,o,u) in a string.
it counts how many vowels are in the string that's fine but i need to find a vowel too..
any idea how to achieve this ?
import java.io.*;
import java.lang.*;
public class VowelsExample {
public static void main(String[] args) throws IOException {
BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
int count = 0;
int i;
char[] vowel= {'a','e','i','o','u','A','E','I','O','U'};
System.out.println("Enter a string :");
String in = input.readLine();
for (i=0; i<in.length(); i++){
vowel[in.length()] = in.charAt(i);
if(vowel[in.length()]=='a' || vowel[in.length()]=='A' || vowel[in.length()]=='e' || vowel[in.length()]== 'E' || vowel[in.length()]=='i' || vowel[in.length()]=='I' || vowel[in.length()]=='o' || vowel[in.length()]=='O' || vowel[in.length()]=='u' || vowel[in.length()]=='U')
count ++;
}
System.out.println(in.contains(in));
System.out.println(String.valueOf(vowel));
System.out.println("total vowels are : " +count);
}
}