I want to empty a list. How to do that?
If by "list" you mean a List
, then the Clear method is what you want:
List list = ...;
...
list.Clear();
You should get into the habit of searching the MSDN documentation on these things.
Here's how to quickly search for documentation on various bits of that type:
List
class itself (this is where you should've started)All of these Google queries lists a bundle of links, but typically you want the first one that google gives you in each case.