How to Remove All Vowels from a String in Java | Java Interview Questions and Answers

preview_player
Показать описание
How to Remove All Vowels from a String in Java | Java Interview Questions and Answers | Java Tutorials | Java Interview Question | Test Automation Central

Рекомендации по теме
Комментарии
Автор

What is the meaning of second command if ....-1

VivekanandaPanda-gs
Автор

what you don't use a regular expression to replace vowels with no space, like this one str.replaceAll("[aeiouAEIOU]", ""); you just need one line and you achieve same result. what you do is fine but it's too much imperative

haroldpepete
Автор

This way of approach is a naive approach and creates too many string objects in string pool in the for loop. It is too much recommended to use replaceAll with regularexpression that replaces vowels with empty character.

RaviShankar-xyzh
welcome to shbcf.ru