title: Move item to bottom of list using List.Move
body: <p>I have a list of items and a "selected" list (a subset of the full list). I want to implement a function that moves the sub list items to the bottom of the full list.</p>
  
  <p>For instance, if I have selected the elements 2,4, &amp; 6 from the list 0,1,2,3,4,5,6,7,8,9 I want this function to have the end result 0,1,3,5,7,8,9,2,4,6</p>
  
  <p>Currently, I'm trying to use something like this, but I'm not sure how to define <code>moveTo</code>:</p>
  
  <pre><code>public object MoveLoopToBottom()
  {
      if (selectedLoops.Count &lt; 1)
          return null;
  
      foreach (ProfilerLoop selected in selectedLoops)
      {
          int moveFrom = ClonedLoops.IndexOf(selected);
          int moveTo = ;
  
          ClonedLoops.Move(moveFrom, moveTo);
      }
  
      return null;
  }
  </code></pre>
  
  <p>I consulted this for how <code>List.Move</code> works: <a href="https://stackoverflow.com/questions/450233/generic-list-moving-an-item-within-the-list">Generic List - moving an item within the list</a> but it appears that it can't "move to end of list". <code>List.Move</code> can (at most) move to the "second-to-last" position (trying to move to the end of the list throws "OutOfRange Exception").</p>
  
  <p>Instead of <code>List.Move</code>, I tried doing <code>List.Remove</code> then <code>List.Add</code> (or <code>List.Add</code> then <code>List.RemoveAt</code>) but calling <code>List.Remove</code> gives me problems with my foreach loop iterations (where <code>List.Move</code> does not).</p>
  
  <p>Any suggestions?</p>