Write a program which takes a string input, converts it to lower case, then prints the same string with all vowels (a, e, i, o, u) removed.

Hint: one good way to do this is to make a new String variable and add all the letters you want to print (i.e. everything except vowels) to it.

Sample Run:

Enter String:
Animation Rerun
nmtn rrn

Respuesta :

Answer:

Scanner scan = new Scanner(System.in);

  System.out.println("Enter String:");

  String v = "aeiou";

  String t = scan.nextLine();

  t =t.toLowerCase();

  String nt ="";

  for(int i = 0; i < t.length(); i++){

  char c = t.charAt(i);

  if (v.indexOf(c) == -1){

  nt += c;

    }

    }

  System.out.println(nt);

   

}

 

}

Explanation:

Good Luck