In this tutorial, we are going to learn java programming to remove all vowels present in the string. For any input string, we have to check whether the string contains vowels or not, if it does then remove the vowels and print the output.
Case1: If the user is given input ‘Quescol’
The output should be ‘Qcsl’
As we know that ‘u’, ‘e’, and ‘o’ are vowels.
Case2: If the user is given input ‘Website’
The output should be ‘Wbst’
As we know that ‘e’, and ‘i’ are vowels
Java Program to Remove Vowel from Given String
As we can observe, for the input string ‘Quescol’ the output generated is ‘Qscl’. Where the vowels ‘u’, ‘e’, and ‘o’ are removed.
While iterating through the string, when vowels were found the vowels were replaced and the rest characters were concatenated and stored in strBuffer.