Listnames = new List {"John", "Doe", "Jane", "Doe"}; names.RemoveAt(1); // Removes the element "Doe" at index position 1
ListThis code removes the last element in the numbers list which is "50". In both examples, the RemoveAt method is called on the Listnumbers = new List {10, 20, 30, 40, 50}; numbers.RemoveAt(numbers.Count - 1); // Removes the last element in the list