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
Did you mean
"Alabama" =~ /Ba/i #=> 3
?
http://www.ruby-doc.org/core-1.9.3/Regexp.html , section Options
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.