Given a string “str”, the task is to duplicate vowels in this string.
Input: str = "geeks" Output: geeeeks Input: str = "java" Output: jaavaa
Approach: Iterate the string using a loop. Check if the character is a vowel and duplicate it. Return
then print the resultant string.
Below is the implementation of the above approach:
Original String: helloworld String with Vowels duplicated: heelloowoorld
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.
- Program to remove vowels from a String
- C program to count number of vowels and consonants in a String
- Program to count vowels in a string (Iterative and Recursive)
- Python program to count number of vowels using sets in given string
- Program to count vowels, consonant, digits and special characters in string.
- Java program to print all duplicate characters in a string
- Check if a string can be converted to another string by replacing vowels and consonants
- First X vowels from a string
- Modify the string such that it contains all vowels at least once
- Reverse vowels in a given string
- Program to accept a Strings which contains all the Vowels
- Permutations of string such that no two vowels are adjacent
- Longest Subsequence of a String containing only vowels
- Count the pairs of vowels in the given string
- Remove consecutive vowels from string
- Replace all consonants with nearest vowels in a string
- Print reverse string after removing vowels
- Check whether the vowels in a string are in alphabetical order or not
- Modify string by removing vowels in between two consonants
- Replace every vowels with lexicographically next vowel in a 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 firstname.lastname@example.org. 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.