From: "Jesús Gabriel y Galán" Date: 2008-04-16T06:33:19+09:00 Subject: Re: Hash or bidimensional Array when key is case insensitive? On Tue, Apr 15, 2008 at 10:50 PM, Iñaki Baz Castillo wrote: > El Martes, 15 de Abril de 2008, Jesús Gabriel y Galán escribió: > > > Another approach is to store it in a hash, but downcase the key before > > storing and retreiving: > > > > irb(main):001:0> h = {"get" => "value_for_get", "post" => "value_for_post"} > > => {"get"=>"value_for_get", "post"=>"value_for_post"} > > irb(main):002:0> method = "gEt" > > => "gEt" > > irb(main):003:0> h[method.downcase] > > => "value_for_get" > > Thanks, but the problem is exactly the opposite: I receive a request that can > contain parameter name in low or uppercase, and I need to process them but > keeping them untouched to forward the request to other location. > If I understand you correctly, in my snippet above, the variable method will contain what you receive. You downcase it for searching in the hash, but still have the original string to pass it along. Am I right? Maybe I am getting the order of your stuff wrong. Can you post an example of what you have? Jesus.