string contains mixed case : String comparisons « String « Ruby
- Ruby
- String
- String comparisons
string contains mixed case
string = "This is a test"
if string =~ /[A-Z]/ and string =~ /[a-z]/
puts "string contains mixed case"
end
Related examples in the same category