Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new string = ""
- index starting at 0, to keep track of word position
- for every character:
- if the character is a vowel:
- if its the first character in the word:
- new string += character
- move the index up by 1
- otherwise:
- newstring += empty string
- move the index up by 1
- if the character is a space:
- new string += character
- we're about to hit a new word; reset the index to 0
- otherwise, it's a consonant:
- new string += character
- move the index up by 1
- return the new string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement