Reputation: 451
Is there any way to use casecmp in Ruby in conjunction with pattern matching? For example, if I want to compare "Ba" with "Alabama", would I be able to do it with casecmp?
Thanks so much
Upvotes: 1
Views: 718
Reputation: 9225
Did you mean
"Alabama" =~ /Ba/i #=> 3
?
http://www.ruby-doc.org/core-1.9.3/Regexp.html, section Options
Upvotes: 1