How to remove the list <T>?

I have a list:

List<int> MyList = new List<int>(); 

I added 10 int values ​​to it:

 for{i=1;i<10;i++} MyList.Add(1); 

Can I make it empty with one shot and not use it

  • 10x iteration of the Remove function
  • RemoveAll with a common delegate Predicate<(Of <(T>)>) .
+4
source share
1 answer
+15
source

All Articles