|
---|
pigLatin |
Write a function that converts a sentence into pig latin. |
Rules for converting to pig latin: |
- For words that begin with a vowel (a, e, i, o, u), add “way”. - Otherwise, move all letters before the first vowel to the end and add “ay”. - For simplicity, no punctuation will be present in the inputs. |
Examples |
<br>#Example 1<br>pigLatinSentence("this is pig latin")<br>output = "isthay isway igpay atinlay"<br><br>#Example 2<br>pigLatinSentence("wall street journal")<br>output = "allway eetstray ournaljay"<br> |
Notes |
All letters will be in lowercase. |