Java program to remove all the vowels from a string1 min read

This post shows, How to remove all vowels from a string in java? with the help of replaceAll() method.

Remove vowels from a string in java:

Explanation:
Removing vowels in java is easy, we will take the user input with the help of a Scanner class. we will use replaceAll() which takes in two parameters, one is the string to be replaced and another one is the string to be replaced with.

Also, the vowels are “aeiou” so we replace those vowel letters by an empty string (“”) for both uppercase and lowercase vowel letters. Then print the result string without vowels.


Java program to remove all the vowels from a string.

The output of removing vowels from a string in java: