Removing objects from a list in C#

Hi,

Does anyone know how to remove objects from a list, or all objects in a list in C#???

Thanks

Adding the list

public List<string> messages = new List<string>();

messages.Add("test1");
messages.Add("test2");
messages.Add("test3");

to clear the list

messages.Clear();

List<T>.RemoveAt(Int32) Method (System.Collections.Generic) | Microsoft Learn - you can find your answer there. look at remove, removeAll and removeAt