Program to check if a vowel is present in the string

 public class StringContainsVowels {

public static void main(String[] args) { System.out.println(stringContainsVowels("Hello")); // true System.out.println(stringContainsVowels("TV")); // false } public static boolean stringContainsVowels(String input) { return input.toLowerCase().matches(".*[aeiou].*"); } }

Comments

Popular posts from this blog

Android - Using KeyStore to encrypt and decrypt the data

Stack and Queue

Java Reflection API