Created
December 27, 2023 21:56
-
-
Save petergi/ec7a36ce22a05a285236aac173f7b49b to your computer and use it in GitHub Desktop.
Checks to see if a given sentence is a Pangram
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 isPangram(string: String) -> Bool { | |
let alphabet = "abcdefghijklmnopqrstuvwxyz" | |
let lowerCaseString = string.lowercased() | |
for letter in alphabet { | |
if !lowerCaseString.contains(letter) { | |
return false | |
} | |
} | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment