From: Chris Howe Date: 2009-07-17T14:48:50+09:00 Subject: Re: how to know Array if have key? --000e0cd47b7e7ceba5046ee057b9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit If you have a hash and you want to find whether or not a given value exists as a key you can use the "has_key?" method h = { "a" => 100, "b" => 200 } h.has_key?("a") #=> true h.has_key?("z") #=> false On Fri, Jul 17, 2009 at 12:09 PM, Zhenning Guan wrote: > a_array= [{"1"=>"11"}, {"2"=>"22"}] > how to test if a_array have a key "11"???? > -- > Posted via http://www.ruby-forum.com/. > > --000e0cd47b7e7ceba5046ee057b9--