From: Roy Zuo Date: 2011-04-16T12:59:20+09:00 Subject: Re: how to count values in an array using 1.8.6 ? How about countme.uniq.size On Sat, Apr 16, 2011 at 12:49:06PM +0900, Richard Sandoval wrote: > Hi, > > How can I count all keys in an array? > > For instance, I want to do this > > >> countme = [1,2,3,4,4,4,4,4,5] > => [1, 2, 3, 4, 4, 4, 4, 4, 5] > >> countme.count > => 9 > > but in ruby 1.8.6, there is only size which doesn't quite work... > > -- > Posted via http://www.ruby-forum.com/. > -- ______________________________________________________ / yo-yo, n.: \ | | | Something that is occasionally up but normally down. | | | \ (see also Computer). / ------------------------------------------------------ \ ,__, \ (oo)____ (__) )\ ||--|| *