How to remove the element from the specified index of the List or From the list

1. List<T>.RemoveAt (Int32) Method

This method is used to remove the element at the specified index of the List

Syntax:

list.RemoveAt (int index)

Parameters:

index: It is the zero-based starting index of the element which is to be removed.
count: It is the number of the elements which is to be removed.

Exceptions:

Exceptions: This method will give ArgumentOutOfRangeException if the index is less than 0 or equal to or greater than list.Count.

2. List.Remove("itemToBeRemoved")

This method takes an item as a ​parameter and removes the first occurrence of that item from the list.

3. List.Clear()

The Clear() method removes all elements from the list.