c#去除List中的重复项
List<string> list = new List<string> {"a", "a", "b", "b", "c", "c"} //(1) var varNew = new HashSet<string> (list); foreach (string item in varNew) { Debug.Log ("item = " + item); } /* item = a item = b item = c */ //(2) var varNew1 = list.Distinct ().ToList (); foreach (string item in varNew1) { Debug.Log ("item = " + item); } /* item = a item = b item = c */