From: Pit Capitain Date: 2009-02-12T07:32:22+09:00 Subject: Re: Array uniq 2009/2/11 Stuart Little : > This > > dateCheck = [time.gsub(/\s/, '')[0..7] + time[26..29]] > #printdata.push(dateCheck) > @alerts.push dateCheck > > gets me: > > TueAug052008 > TueAug052008 > TueAug052008 > WedAug062008 > WedAug062008 > TueAug052008 This is not what I suggested. I just wanted the output of p dateCheck p dateCheck.uniq and I'm sure we can tell you immediately what's going wrong. If you don't want to do this for some reason, I repeat what I've written before: you still have an array with just one element: a string of size 12. So #uniq returns the same array. But if you still say that you get six lines of output, I suspect that you execute the code you've shown in a loop and that you are filling the array @alerts. If this is the case, you are using #uniq at the wrong place. Either do @alerts.uniq *after* the loop or use the code David has shown you. Regards, Pit