From: 7stud -- Date: 2009-10-31T05:12:01+09:00 Subject: Re: Merging hashes using both symbols and strings as keys shenry wrote: > I'd like to avoid using strings as the keys in > my default hash. > h1 = { :name => "Joe", :age => 50 } h2 = { "name" => "Bill", :phone => "123-4567"} h2.each do |key, val| h1[key.to_sym] = val end p h1 --output:-- {:age=>50, :phone=>"123-4567", :name=>"Bill"} -- Posted via http://www.ruby-forum.com/.