From: Axel Etzold Date: 2007-06-28T17:44:41+09:00 Subject: Re: Can i calculate the data number in array? Dear Cool, maybe this is what you want: class Array def count k=Hash.new(0) self.each{ |x| k[x]+=1 } k end end my_array = ["a", "a", "a", "b", "b", ā€œcā€, "c", "c","d", "d", "e"] my_array.count It gives you a Hash, though, and the numbers are Integers, not Strings, but this seems more reasonable :) Best regards, Axel -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail