Todd Benson wrote: > On Thu, Sep 18, 2008 at 4:17 PM, Nick Bo <bornemann1 / nku.edu> wrote: >> be able to push the value of the count into a new array and make a hash >> using (word, count) > > a = "duck","duck","goose" > a.inject(Hash.new(0)) {|h, e| h[e] += 1; h} > > => {"goose"=>1, "duck"=>2} > > hth a little, > Todd Todd, that is just wonderful! I have been playing with variations from this for an hour. GREAT stuff! -- Posted via http://www.ruby-forum.com/.