Gistlib Logo

gistlib

case-insensitive pangram-checker one-liner function in julia? in ruby

main.rb
def pangram_checker(sentence)
  ("a".."z").all? { |char| sentence.downcase.include?(char) }
end
96 chars
4 lines

This Ruby function will return true if the given sentence is a pangram (contains all 26 letters of the English alphabet, case-insensitive), and false otherwise.

similar ruby code snippets

give a one-liner function in julia that checks if a sentence is a pangram and it is case insensitive in ruby
remove a character from a string in ruby
find the kth index of a character in a string in ruby
find the last character in a string in ruby
prepend a string to the beginning of another string in ruby
insert a string into another string at a specific index in ruby
find the name of a csv file in ruby
create a password with uppercase letters and lowercase letters in ruby
find the shortest word in a string in ruby
find the parent directory of a directory in ruby

related categories

string-manipulation
case-insensitive
pangram
one-liner-function
ruby

gistlibby LogSnag