From: Harry Kakueki Date: 2007-07-10T21:44:21+09:00 Subject: Re: Find display value in array > Type = [["key","value"],["key..","value.."],["..",".."]] > > Now i want to the the display (value) when i have the key, is this a OK > way to do it? Or is there a better way? > > Type.select{|key,disp| key == "H" }.collect{|key,value|value}.to_s > Is this what you want to do? If so, I think iteration is easier than that. I think it is also faster but I did not check. arr = [["A",2],["H",3],["H",4]] arr.each {|x| print x[1] if x[0] == "H"} Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/