Finding duplicates in an array

an application i am working on sends emails to an array of users. it is
possible for the user’s email to actually be in the array more than

i don’t have a real strong grasp of the ruby syntax yet, but is there an
easy way to go through and either remove all of the duplicates or at
least only send an email to that user once?

i just found something in the reference guide on the ruby site.

previously i was using something like:

emailArr << newEmail

but i saw this:

emailArr | [newEmail]

is this what i should do when creating the array? or is there a better
way to accomplish what i need?

On Monday, June 19, 2006, at 9:38 PM, Josh K. wrote:

Rails mailing list
removed_email_addre[email protected]

new_array = some_array.uniq


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs