From: Kevin Olbrich Date: 2006-01-05T04:51:33+09:00 Subject: Re: Question on iterating a hash > Wouldn't it be easier to iterate through the keys? I'm not sure why > Phil didn't want to. (Phil?) > > h.keys.select {|k| h[k] == 1} > Since he wants the keys of the hash in an array, wouldn't you need to do this.. result = h.keys.select {|k| h[k] == 1} result = result.keys I'm sure there's a one-liner for this somewhere, but I need more coffee. -- Posted via http://www.ruby-forum.com/.