===

rxp === str â true or false
Instance Public methods

Case EqualityâUsed in case statements.

a = "HELLO"
case a
when /^[a-z]*$/; print "Lower case\n"
when /^[A-Z]*$/; print "Upper case\n"
else;            print "Mixed case\n"
end
#=> "Upper case"

Following a regular expression literal with the === operator allows you to compare against a String.

/^[a-z]*$/ === "HELLO" #=> false
/^[A-Z]*$/ === "HELLO" #=> true
doc_ruby_on_rails
2015-05-05 04:26:35
Comments
Leave a Comment

Please login to continue.