Tim Hunter
5/29/2006 6:10:00 PM
Bucco wrote:
> Could you give an example?
>
> Thanks:)
> SA
>
Sure.
irb(main):005:0> h = {'green'=>31, 'purple'=>12, 'red'=>23, 'yellow'=>40}
=> {"green"=>31, "red"=>23, "yellow"=>40, "purple"=>12}
irb(main):006:0> h.keys.sort.each {|k| puts h[k]}
31
12
23
40
=> ["green", "purple", "red", "yellow"]