title: C# List loop within a loop?
body: <p>I'm working on a class project and here is what I have so far. I know the code returns true when it finds a match but I want it to keep looping until no more instances are found. </p>
  
  <p>I've looked at numerous sites on <code>for/while</code> loops but I can't seem to get the syntax correct and/or it doesn't work when applying the logic.</p>
  
  <pre><code>public bool Remove(T toRemove)
  {
      for (int i = 0; i &lt; count; i++)
      {
          if (items[i].Equals(toRemove))
          {
              int removeIndex = i;
              for (int j = removeIndex; j &lt; count - 1; j++)
              {
                  items[j] = items[j + 1];
              }
              return true;
          }
      }
      return false;
  }
  </code></pre>