Listnames = new List {"John", "Mary", "David"}; names.Clear(); // clears all strings from the list
ListThe Common List Clear method is part of the System.Collections.Generic namespace.numbers = new List { 1, 2, 3, 4, 5 }; numbers.Clear(); // clears all integers from the list