title: In C# how to remove items in an array after a certain length?
body: <p>If i have an array of objects and I want to remove all items after a certain length</p>
  
  <p>for example if the startlength of the array is 10 and I want to only keep the first 5 items in the array and remove everything after that.  NOTE: The array might be less than 5 which would do nothing.</p>
  
  <pre><code>  int startLength = 10;
    int maxLength = 5;
    List&lt;MYObject&gt; myList = CreateListofObjects(startLength);
  </code></pre>
  
  <p>I want something like "RemoveAfter" where "RemoveAfter" would do something like this:</p>
  
  <pre><code>  myList = myList.RemoveAfter(maxLength);
  
    Assert.IsTrue(myList.Count() ==5);
  </code></pre>