How to Delete C# List Items

Remove All Items

// Create a list of strings
List<string> AuthorList = new List<string>();
AuthorList.Add("Mahesh Chand");
AuthorList.Add("Praveen Kumar");
AuthorList.Add("Raj Kumar");
AuthorList.Add("Nipun Tomar");
AuthorList.Add("Dinesh Beniwal");

AuthorList.Remove("Mahesh Chand");

The Clear method removes all items from the List. The following code snippet removes all items by calling the Clear method. 

AuthorList.Clear();

Download Free book: Programming List with C#


Up Next
    Ebook Download
    View all
    Learn
    View all