Advertisement
Guest User

Untitled

a guest
May 23rd, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. new string = ""
  2. index starting at 0, to keep track of word position
  3. for every character:
  4. if the character is a vowel:
  5. if its the first character in the word:
  6. new string += character
  7. otherwise:
  8. newstring += empty string
  9. move the index up by 1
  10. if the character is a space:
  11. new string += character
  12. we're about to hit a new word; reset the index to 0
  13. otherwise, it's a consonant:
  14. new string += character
  15. move the index up by 1
  16. return the new string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement