Given a string and the task is to count vowels, consonant, digits and special character in string. Special character also contains the white space.
Input : str = "geeks for geeks121" Output : Vowels: 5 Consonant: 8 Digit: 3 Special Character: 2 Input : str = " A1 B@ d adc" Output : Vowels: 2 Consonant: 4 Digit: 1 Special Character: 6
Vowels: 5 Consonant: 8 Digit: 3 Special Character: 2
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the number of words of X vowels and Y consonants that can be formed from M vowels and N consonants
- Count of N size strings consisting of at least one vowel and one consonant
- Alternate vowel and consonant string
- Print all Subsequences of String which Start with Vowel and End with Consonant.
- Lexicographically first alternate vowel and consonant string
- Count of adjacent Vowel Consonant Pairs
- Program to find if a character is vowel or Consonant
- Replace every consonant sequence with its length in the given string
- Check if a string contains uppercase, lowercase, special characters and numeric values
- Program to count vowels in a string (Iterative and Recursive)
- Reverse a string without affecting special characters
- Calculate Sum of ratio of special characters to length of substrings of the given string
- Python program to count number of vowels using sets in given string
- Check if a string can be converted to another string by replacing vowels and consonants
- Count of ungrouped characters after dividing a string into K groups of distinct characters
- Minimum digits to be removed to make either all digits or alternating digits same
- Count special palindromes in a String
- Arrangement of the characters of a word such that all vowels are at odd places
- Count the number of vowels occurring in all the substrings of given string
- Count the pairs of vowels in the given string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.