Skip to content

Instantly share code, notes, and snippets.

@olumidayy
Created April 2, 2020 11:00
Show Gist options
  • Save olumidayy/cbe39aa455d3dbe51f811a7c4df7d85f to your computer and use it in GitHub Desktop.
Save olumidayy/cbe39aa455d3dbe51f811a7c4df7d85f to your computer and use it in GitHub Desktop.
day 9 mobile
void main() {
print(isPangram('Mr. Jock, TV quiz PhD., bags few lynx'));
print(isPangram('The quick brown fox jumps over the lazy dog.'));
}
String isPangram(sentence) {
// checks to see if the sentence contains at least one occurence each
// of all the English alphabets
String letters = 'abcdefghijklmnopqrstuvwxyz';
sentence = sentence.toLowerCase();
for (var i in letters.split('')) {
// taking each letter and comparing to the sentence
if(!sentence.contains(i)){
// if the sentence doesn't contain one of the alphabets
return 'Not a Pangram';
}
}return 'Is a Pangram';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment