From: Stefano Crocco Date: 2008-02-12T06:24:22+09:00 Subject: Re: non case sensitive searching Alle Monday 11 February 2008, Adam Akhtar ha scritto: > If i want to see if a list contains a particular word how would i go > about doing so with letter case not being important. Normally two words > spelt the same are not equal if they differ in case. > > i.e. Shell != shell > or ShEll != shell > > At first i thought simply conveting both the list and the word to search > into uppercase thus making them the same but doing so would not be very > efficient if the list is very big. > > Any ideas?? Use String#casecmp. According to ri documentation, it works as String#<=> but is not case sensitive. For example: "abc" <=> "Abc" => 1 "abc".casecmp "Abc" => 0 Stefano