Created
April 24, 2019 15:16
-
-
Save vicxruiz/6bd55880d9419beefe7c78e98afdd452 to your computer and use it in GitHub Desktop.
LambdaSchool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func numberOfVowels(in string: String) -> Int { | |
var numberOfVowels: Int = 0 | |
for x in string { | |
if x == "a" || x == "e" || x == "i" || x == "o" || x == "u" { | |
numberOfVowels += 1 | |
} | |
} | |
return numberOfVowels | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment