I want to delete the consonants of a string, that is, if hello is entered, its output prints or . I have this code, but it does not do it to me
import java.util.Scanner;
public class vocales {
public static void main(String args[]) {
Scanner teclado = new Scanner(System.in);
System.out.println("Escriba una cadena para separar vocales.");
String x = teclado.next();
int s = x.length();
char k;
for (int i = 0; i < s; i++) {
k = x.charAt(i);
if ((k != 'a') || (k != 'e') || (k != 'i') || (k != 'o')
|| (k != 'u')) {
k = ' ';
}
System.out.print(k);
}
}
}
Does anyone see the fault? To separate the consonants from the vowels, that is to say hello hl, if you do it well but for the other form no.