Java Coding Series: How to check vowel is present in the string?
Approach 1 : Most Useful, We will use regex to find wether vowels present in the stirng or not.
public static Boolean isVowelPresent(String sample) {
return sample.toLowerCase().matches(".\*\[aeiou\].\*");
}
Approach 2 : Traversing one by one...
hashcodehub.hashnode.dev1 min read