Design a program to take a word as an input, and then encode it into a Pig Latin. A Pig Latin is an encrypted word in English, which is generated by doing following alterations:
The first vowel occurring in the input word is placed at the start of the new word along with the remaining alphabets of it. The alphabets present before the first vowel are shifted at the end of the new word followed by “ay”.
Input: s = "paris" Output: arispay Input: s = "amazon" Output: amazonay
1) Find index of first vowel. 2) Create pig latin by appending following three. .....a) Substring after starting with the first vowel ........till end. .....b) Substring before first vowel. .....c) "ay".
This article is contributed by dewangNautiyal. 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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Latin alphabet cipher
- Longest Common Prefix using Word by Word Matching
- C program to Replace a word in a text by another given word
- Run Length Encoding
- Run Length Encoding in Python
- Encryption vs Encoding vs Hashing
- Check if an encoding represents a unique binary string
- Basic Type Base64 Encoding and Decoding in Java
- Program to implement Run Length Encoding using Linked Lists
- Tribonacci Word
- Fibonacci Word
- Minimum Word Break
- Next word that does not contain a palindrome and has characters from first k
- Second most repeated word in a sequence
- Possibility of a word from a given set of characters
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.