EDIT:
I missed the part "preferably without using LINQ",
You may try the following if you are using .Net framework 2.0 or you don't want to use LINQ.
List<string> list = new List<string> { "abc", "abc", "ab", "def", "abc", "def" };
list.Sort();
int i = 0;
while (i < list.Count - 1)
{
if (list[i] == list[i + 1])
list.RemoveAt(i);
else
i++;
}
use Distinct()
List<string> list = new List<string> { "abc", "abc", "ab", "def", "abc","def" };
List<string> uniqueList = list.Distinct().ToList();
The uniqueList
will contain 3
items "abc","ab","def"
Remember to include: using System.Linq;
at the top