From: Rick DeNatale Date: 2009-02-12T07:47:22+09:00 Subject: Re: Array uniq --00163630f0efcb0e450462ac6651 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, Feb 11, 2009 at 5:33 PM, Stuart Little < stuart_clarke1986@hotmail.co.uk> wrote: > That makes sense but how do I avoid this? I cant see how. I need to > dedupe before the data goes into @alerts. > > David and I are trying to tell you the same thing. My last attempt to get through date = "TueAug052008" dateCheck = [] alerts = [] 5.times do dateCheck.push date alerts.push(date) unless alerts.include?(date) end puts "at end alerts is #{alerts.inspect}" puts " and dateCheck is #{dateCheck.inspect}" at end alerts is ["TueAug052008"] and dateCheck is ["TueAug052008", "TueAug052008", "TueAug052008", "TueAug052008", "TueAug052008"] -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale --00163630f0efcb0e450462ac6651--