From: Paul Danese Date: 2008-03-27T23:51:04+09:00 Subject: Re: numbers of a record in an array If you install the facets gem you can use "frequency" e.g. >irb irb:> require 'rubygems' => false irb:> require 'facets' => true irb:> x = %w[a b d e e rkeke ele e ee e e el d] => ["a", "b", "d", "e", "e", "rkeke", "ele", "e", "ee", "e", "e", "el", "d"] irb:> x.frequency => {"ee"=>1, "a"=>1, "b"=>1, "d"=>2, "e"=>5, "el"=>1, "ele"=>1, "rkeke"=>1} -----Original Message----- From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf Of Bu Mihai Sent: Tuesday, March 25, 2008 5:09 AM To: ruby-talk ML Subject: numbers of a record in an array a have an array array=["a","b","c","a","b"] how can i find the numbers of "a", "b","c" items in the array? -- Posted via http://www.ruby-forum.com/. This email and any attached files are confidential and intended solely for the intended recipient(s). If you are not the named recipient you should not read, distribute, copy or alter this email. Any views or opinions expressed in this email are those of the author and do not represent those of the company. Warning: Although precautions have been taken to make sure no viruses are present in this email, the company cannot accept responsibility for any loss or damage that arise from the use of this email or attachments.