title: Removing all elements from List<T>
body: <p>I'm trying to remove all elements when the user clicks Yes on a messagebox, but I'm not really sure how to remove all items on a buttonclick. I am able to remove element at index but not all elements.</p>
  
  <p>This is how I successfully remove element at index:</p>
  
  <pre><code>public void DeleteAt(int anIndex)
  {
      if(CheckIndex(anIndex))
      m_list.RemoveAt(anIndex);
  } 
  </code></pre>
  
  <p>But I want to remove <strong>all</strong> elements.
  I tried doing this:</p>
  
  <pre><code>public void DeleteAll()
  {
        m_list.RemoveAll();
  }
  </code></pre>
  
  <p>But it's not working, it's saying that there needs to be a parameter to <code>RemoveAll();</code> but I don't know what kind of parameter. </p>