From: Stefan Rusterholz Date: 2008-04-16T02:33:25+09:00 Subject: Re: Hash or bidimensional Array when key is case insensitive I単aki Baz Castillo wrote: > And if I use a Hash I'll do the same: > > method = params_hash.find { |param| param[0] =~ /^method$/i }[1] Use a hash and lowercase the keys. If you need to preserve the original casing, do that in the value, e.g. like this: {key.lowercase => [key, value], ...} Another approach would be a special Key class which is like String but has #hash and #eql? redefined to work as if the String was lowercased. There probably are more approaches. Regards Stefan -- Posted via http://www.ruby-forum.com/.