From: Daniel Sheppard Date: 2007-09-26T16:05:28+09:00 Subject: Re: merge two arrays into a hash > key = [ "1", "2", "3"] > value = [ "a", "b" ] > > into: > > myhash = {'1' => 'a' , '2' => 'b' , '3' => ''} For the special case where key and value do not contain arrays: Hash[*key.zip(value).flatten] For the general case: myhash = {} key.zip(value) {|a,b| myhash[a] = b } Dan