Skip to content

Instantly share code, notes, and snippets.

@townie
Created February 24, 2014 00:57
Show Gist options
  • Save townie/9179842 to your computer and use it in GitHub Desktop.
Save townie/9179842 to your computer and use it in GitHub Desktop.
find out the unique
def uniques(list)
list = list.split(',')
list.each_with_index do |num, index|
if list.count(num) > 1
list.delete_at(index)
end
end
list.join(',')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment