Anyone remember Boaty?
You could totally make any old word, right?
- Write a function to turn a string into Somethingy McSomethingface.
- It should accept one string as input. Ignore the case of the input.
- If the word ends in 'y', your function should not add an additional 'y' to the first instance, but should remove it in the second instance.
- If the word ends in 'ey', it should not have an additional 'y' added in the first instance, but should remove both in the second instance.
- The output should only have upper case letters in the first character, the 'M' of 'Mc' and the first character after 'Mc'.
- it only needs to work with strings of 3 or more characters.
boat => Boaty McBoatface Face => Facey McFaceface DOG => Dogy McDogface Family => Family McFamilface Lady => Lady McLadface Donkey => Donkey McDonkface Player => Playery McPlayerface yyy => Yyy McYyface DJ Grand Master Flash => Dj grand master flashy McDj grand master flashface