Lua: Smartest way to add to table only if not already in table, or remove duplicates

Viewed 11292

I have a table of strings. I'd like an easy way to remove all of the duplicates of the table.

So if the table is {a, b, c, c, d, e, e} , after this operation it would be {a, b, c, d, e}

Alternatively, and probably preferably, is there a way to add an element to a table, but only if it is not already contained within the table.

<\noobquestion>

3 Answers
Related