Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. func numberOfVowels(in string: String) -> Int {
  2. var count = 0
  3. for char in string.lowercased() {
  4. switch char {
  5. case "a", "e", "i", "o", "u":
  6. count += 1
  7. default:
  8. ()
  9. }
  10. }
  11. return count
  12. }
  13.  
  14.  
  15. numberOfVowels(in: "The quick brown fox jumps over the lazy dog")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement