From: Daniel Carrera Date: 2003-01-03T13:24:20+09:00 Subject: Re: sort the hash keys > On Friday, January 3, 2003, 2:16:29 PM, Mark wrote: > >> You can also use hash.sort directly, however, be careful. It returns >> an array of [key, value]. So to sort and iterate over the hash hash_a >> do > Better: > > hash_a.each do |key, value| > # do stuff > end I like: hash.keys.sort.each do |key| # do stuff with ~key~ and ~hash[key]~ end Daniel