// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; namespace E { public class Program { public static void Main(string[] args) { List lst = new List(); lst.Add("A"); lst.Add("B"); lst.Add("C"); lst.Add("D"); lst.Add("B"); lst.Add("D"); Console.WriteLine("Original:"); foreach(string s in lst) { Console.WriteLine(s); } List lst2 = lst.FindAll((s) => lst.IndexOf(s) != lst.LastIndexOf(s)); Console.WriteLine("After removing singles:"); foreach(string s in lst2) { Console.WriteLine(s); } } } }