* Dossy (dossy / panoptic.com) wrote:
> On 2002.09.20, Khurram <khabibiuf / hotmail.com> wrote:
> > How can I check hash keys and values without case sensitivity?
> > Specifically I'm referring to the hash ".has_key?" and ".has_value?"
> > methods.  I believe these are case sensitive by default.
> 
>     class Hash
>       def has_ikey?(key)
>         self.keys.map { |key| key.upcase }.member? key.upcase
>       end
>     end

Doesn't iterating through all the keys on a lookup kindof take away the
advantages of a hashtable? :)

Tom.
-- 
   .^.    .-------------------------------------------------------.
   /V\    | Tom Gilbert, London, England | http://linuxbrit.co.uk |
 /(   )\  | Open Source/UNIX consultant  | tom / linuxbrit.co.uk    |
  ^^-^^   `-------------------------------------------------------'