From: WATANABE Hirofumi Date: 2004-04-24T13:22:40+09:00 Subject: Re: Array to Hash Hi, "Pe�a, Botp" writes: > Finally, I got it (dug the archives).. > > >> h2 = Hash[*a] > => {["x", 1]=>["y", 3]} > > But, it looks weird. No, not just the cryptic Hash*a, but the result as > well. I do not see any use of the result. > > I would rather prefer: > > >> h2 = a.to_hash # or a.to_h > {"x"=>1, "y"=>3} Array#flatten >> h2 = Hash[*a.flatten] => {"x"=>1, "y"=>3} -- eban