Skip to content

Instantly share code, notes, and snippets.

@ccellar
ccellar / long-version.cs
Last active September 26, 2015 18:48
Remove duplicate in a list
private static List<T> RemoveDoubleItems<T>(List<T> list)
{
var newList = new List<T>();
var keyList = new Dictionary<T,string>();
foreach (T item in list)
{
if (!keyList.ContainsKey(item))
{
keyList.Add(item, string.Empty);