I have an excel spreadsheet that I am trying to populate a list with only unique values. I have found LinqToExcel which I would prefer not to use. At most there will be 2000 rows which isn't very much.
My thought was:
List<string> lst = new List<string>();
string item;
for (i=2; i<2001; i++)
{
item = ws.cells[i,3];
if(lst.**notInList**(item))
{
lst.Add(item);
}
}
I know that there isn't notInList()
, but I was hoping for something similar or another idea.