Mid Collections

How do you clear a List<T>?

Use the Clear() method to remove all elements.

Example:

list.Clear();

More from C# Programming Tutorial

All questions for this course