From: Christopher Taranto Date: 2011-09-10T02:08:24+09:00 Subject: Re: Creating a hash from two arrays --bcaec52999af25f39704ac8539ba Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 9, 2011 at 9:51 AM, simon harrison wrote: > Hi. Can anyone help with this? I'd like to end with a hash like so: > > hash = {{"A" => 'alpha'}, {'B' => 'bravo'}} etc... > > I'm not sure whether I can use group_by and how to handle case > insensitity. Cheers for any help. > > > irb(main):001:0> s = ('A'..'Z').to_a > => ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", > "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] > > irb(main):003:0> t = %w(alpha bravo Charlie Zebra) > => ["alpha", "bravo", "Charlie", "Zebra"] > > -- > Posted via http://www.ruby-forum.com/. > > Funny, I just looked this up yesterday: http://rosettacode.org/wiki/Hash_from_two_arrays#Ruby --bcaec52999af25f39704ac8539ba--