Given three strings(without spaces). The task is to print the new string after modifying the three given string as follows:
- Replace all the vowels present in the first string with “*”.
- Don’t change anything in the second string.
- Replace all the consonants in the third string with “$”.
- Concatenate all of the three string to obtain the new string.
Input : how are you Output : h*ware$ou Input : geeks for geeks Output : g**ksfor$ee$$
The idea is to traverse the first string and keep checking if any character is vowel or not. Replace the character in the first string which is vowel with “*”. Similarly, traverse the third string and keep checking if any character is not a vowel. If a character in the third string is not a vowel(then it is a consonant), replace it with ‘$’.
Finally, concatenate the three strings and print the newly concatenated string.
- Print string after removing all (“10” or “01”) from the binary string
- Check whether the number formed by concatenating two numbers is a perfect square or not
- Minimum swaps required to move all vowels occurs after consonants in a given string
- Print the array after K operations
- Restore original String from given Encrypted String by the given operations
- Program to print all substrings of a given string
- Program to find the kth character after decrypting a string
- Find if a string starts and ends with another given string
- Print sublist of a given Linked List specified by given indices
- Print the first and last character of each word in a String
- Total money to be paid after traveling the given number of hours
- Immediate smallest number after re-arranging the digits of a given number
- Count of a, b & c after n seconds for given reproduction rate
- Program to find the time after K minutes from given time
- Find the day of the week after K days from the given day
- Minimum N-Digit number required to obtain largest N-digit number after performing given operations
- Print the pyramid pattern with given height and minimum number of stars
- Program to print all the numbers divisible by 3 and 5 for a given number
- Print a pair of numbers with the given Sum and Product
- String containing first letter of every word in a given string with spaces
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.