Program to accept a Strings which contains all the Vowels | C # implementation to check that a String contains all vowels ; Function to to check that a String contains all vowels ; Hash Array of size 5 such that the index 0 , 1 , 2 , 3 and 4 represent the vowels a , e , i , o and u ; Loop the String to mark the vowels which are present ; Loop to check if there is any vowel which is not present in the String ; Function to to check that a String contains all vowels ; Driver Code
using System ; class GFG { static int checkIfAllVowels ( String str ) { int [ ] hash = new int [ 5 ] ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] == ' A ' str [ i ] == ' a ' ) hash [ 0 ] = 1 ; else if ( str [ i ] == ' E ' str [ i ] == ' e ' ) hash [ 1 ] = 1 ; else if ( str [ i ] == ' I ' str [ i ] == ' i ' ) hash [ 2 ] = 1 ; else if ( str [ i ] == ' O ' str [ i ] == ' o ' ) hash [ 3 ] = 1 ; else if ( str [ i ] == ' U ' str [ i ] == ' u ' ) hash [ 4 ] = 1 ; } for ( int i = 0 ; i < 5 ; i ++ ) { if ( hash [ i ] == 0 ) { return 1 ; } } return 0 ; } static void checkIfAllVowelsArePresent ( String str ) { if ( checkIfAllVowels ( str ) == 1 ) Console . Write ( " Not ▁ Accepted STRNEWLINE " ) ; else Console . Write ( " Accepted STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { String str = " aeioubc " ; checkIfAllVowelsArePresent ( str ) ; } }