using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; namespace Console1 { class Program { static IEnumerable RemoveDuplicates(List inputList) { inputList.Sort(); return inputList.Distinct(); } static void Main(string[] args) { var myList = new List { "John", "Andrew", "James", "Jack", "Andrew", "Bob", "Jack" }; var newList = RemoveDuplicates(myList); foreach (var item in newList) { Console.WriteLine(item); } } } }