// 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; class MainClass { public static void Main(string[] args) { ArrayList lst1 = new ArrayList(); lst1.Add("A"); lst1.Add("BB"); lst1.Add("CCC"); lst1.Add("BB"); lst1.Add("A"); foreach(string elm in lst1) Console.WriteLine(elm); ArrayList lst2 = new ArrayList(); for(int i = 0; i < lst1.Count; i++) if(!lst2.Contains(lst1[i])) lst2.Add(lst1[i]); foreach(string elm in lst2) Console.WriteLine(elm); } }