How to Remove vowels from a word in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to Remove vowels from a word in java

5th Feb 2018, 4:45 PM
HARSH SAHU
2 Answers
+ 9
str = str.toLowerCase().replaceAll("[aeiou]", "");
5th Feb 2018, 5:09 PM
Hatsy Rei
Hatsy Rei - avatar
+ 3
if you want to keep the original string: str = str.replaceAll("[aeiouAEIOU]", "");
5th Feb 2018, 7:27 PM
Jeremy
Jeremy - avatar