all with contains on lower case

Панграма
Панграма у треку Rust
pub fn is_pangram(sentence: &str) -> bool {
    let sentence_lowered = sentence.to_lowercase();
    ('a'..='z').all(|ltr| sentence_lowered.contains(ltr))
}
  • This begins by lowercasing the input by using to_lowercase.
  • It then checks if all letters in the alphabet are contained in the sentence, using the Iterator method all with the str method contains. If all of the letters in the alphabet are contained in the sentence, then the function will return true.
Translation missing: uk.number.nth.ordinalized Sep 2026 · Це було корисно?