Use A Case Statement As A Cond Statement
some_string = "What"
case
when some_string.downcase == some_string
puts "The string is all lowercase."
when some_string.upcase == some_string
puts "The string is all uppercase."
else
puts "The string is mixed case."
end
#=> The string is mixed case.Last updated