Program to check vowel is present in a given String or not

	

package com.demo; public class ContainsVowelsOrNot { public static void main(String[] args) { //first string String str = "Java"; System.out.println("Vowels is present : "+isVowelsPresent(str)); //second string str = "bcd"; System.out.println("Vowels is present : "+isVowelsPresent(str)); } private static boolean isVowelsPresent(String str) { if(str == null) { throw new IllegalArgumentException(); } return str.toLowerCase().matches(".*[aeiou].*"); }
Share:

No comments:

Post a Comment

Quote of the day

Popular Posts

Featured Post

Collection Framework Overview

Collection:- A collection (sometimes called a container) is simply an object that groups multiple elements into single unit. Collect...

Youtube Page

Facebook Page

Recent Posts

About

I am Shivaji Chandra and I'm a Computer Science Engineer. I love to write poems, jokes and quotes. click here →