give a one-liner function in julia that checks if a sentence is a pangram and it is case insensitive in ruby

In Ruby, you can create a one-liner function to check if a sentence is a pangram and make it case-insensitive using the following code:

main.rb
def pangram?(sentence)
  ('a'..'z').all? { |char| sentence.downcase.include?(char) }
end
89 chars
4 lines

This function uses a range from 'a' to 'z' to iterate over all the letters of the alphabet. It checks if each letter is present in the given sentence after converting it to lowercase using downcase. The all? method ensures that all the characters are present in the sentence, making it a pangram.

related categories

gistlibby LogSnag