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 firstname.lastname@example.org. 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.
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.
- Latin alphabet cipher
- C program to find and replace a word in a File by another given word
- 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
- Program to implement Run Length Encoding using Linked Lists
- Basic Type Base64 Encoding and Decoding in Java
- Tribonacci Word
- Fibonacci Word
- Length Of Last Word in a String
- Second most repeated word in a sequence
- Minimum Word Break
- Next word that does not contain a palindrome and has characters from first k
- Possibility of a word from a given set of characters
- Most frequent word in an array of strings
- Remove the first and last character of each word in a string
- Print the first and last character of each word 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 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.