From: "Morris, Chris" Date: 2002-03-23T07:19:49+09:00 Subject: RE: Weird problem with Ruby debugger > So, if the $= variable is obsolete, can anybody tell me what is the > approved or recommanded way of doing a case-insensitive comparison of > two strings, With regexp, using the i flag makes the match test case-insensitive. irb(main):004:0> b = "lowercase" "lowercase" irb(main):005:0> b =~ /LoWERCase/ nil irb(main):006:0> b =~ /LoWERCase/i 0 > or of getting the Array#include? method to do a case > insensitive comparison, as in: This one isn't quite as elegant (assuming the previous one was...) ... but it works: irb(main):007:0> a = ["help", "me"] ["help", "me"] irb(main):008:0> a.collect { |s| s.upcase }.include? "HELP" true irb(main):009:0> a.collect { |s| s.upcase } ["HELP", "ME"] Chris