From: Mage Date: 2006-08-15T01:01:24+09:00 Subject: Re: hash.keys and hash.values Robert Klemme wrote: > > >> hash={1=>2,3=>4} > => {1=>2, 3=>4} > >> keys,vals = hash.inject([[],[]]) {|(ks,vs),(k,v)| [ks << k, vs << v]} > => [[1, 3], [2, 4]] > >> keys > => [1, 3] > >> vals > => [2, 4] Thank you, maybe I will benchmark this at home against the transpose solution. Mage