From: Robert Klemme Date: 2011-09-12T23:06:58+09:00 Subject: Re: Creating a hash from two arrays On Fri, Sep 9, 2011 at 7:24 PM, Aaron D. Gifford wrote: > Or using just the list of words and Ruby 1.9: > >  ansi = %w{Alpha Bravo Charlie Delta ...... Zulu} >  zippedhash = Hash[ansi.map{|x| x[0].downcase}.zip(ansi)] > > @Adam Prescott, I think you're right about 1.8, which is why I > prefaced my response with "This works in 1.9 at least."  *chuckle* or - avoiding the temporary Array: ansi = %w{Alpha Bravo Charlie Delta ...... Zulu} hash = {} ansi.each {|w| hash[w[0].upcase] = w} Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/