title: What is an "index out of range" exception, and how do I fix it?
body: <p>I'm getting one of the following errors:</p>
  
  <ul>
  <li>"Index was out of range. Must be non-negative and less than the size of the collection"</li>
  <li>"Insertion index was out of range.  Must be non-negative and less than or equal to size."</li>
  <li>"Index was outside the bounds of the array."</li>
  </ul>
  
  <p>What does it mean, and how do I fix it?</p>
  
  <p><strong>See Also</strong><br>
  <a href="http://msdn.microsoft.com/en-us/library/system.indexoutofrangeexception" rel="noreferrer">IndexOutOfRangeException</a><br>
  <a href="http://msdn.microsoft.com/en-US/library/system.argumentoutofrangeexception" rel="noreferrer">ArgumentOutOfRangeException</a></p>