Skip to content

Instantly share code, notes, and snippets.

@vicxruiz
Created April 24, 2019 15:16
Show Gist options
  • Save vicxruiz/6bd55880d9419beefe7c78e98afdd452 to your computer and use it in GitHub Desktop.
Save vicxruiz/6bd55880d9419beefe7c78e98afdd452 to your computer and use it in GitHub Desktop.
LambdaSchool
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