import java.util.Scanner;
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter String name: " );
String name = scanner.nextLine();
int k = name.length();
int f = 1;
String z = "";
for(int i=0; i<k; i++) {
char c = name.charAt(i);
if(c == 'A' || c == 'a' || c == 'E' || c =='e' || c == 'I' || c == 'i' || c == 'O' || c == 'o' || c=='U' || c=='u')
f=0;
else
z = z+c;
}
System.out.println("String Without Vowels is : " +z);
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter