From: Mathieu Bouchard Date: 2001-05-18T06:21:14+09:00 Subject: [ruby-talk:15343] Re: Array to Hash? On Fri, 18 May 2001, Jim Freeze wrote: > Is there a built in way to turn an array > into a hash? I know that I can turn a hash > into an arry, but I would like to do the > opposite. > Something like > h={1,2,3,4} > but where the list is an array. h = Hash[1,2,3,4] therefore h = Hash[*[1,2,3,4]] therefore a = [1,2,3,4] h = Hash[*a] matju