title: StartIndex cannot be less than zero
body: <p>im working on a text-editor and the time i input text on it then i deleted it the error:</p>
  
  <blockquote>
    <p>StartIndex cannot be less than zero</p>
  </blockquote>
  
  <p>pointing this code:</p>
  
  <pre><code>String line = rtb.Text.Substring(start, end - start);
  </code></pre>
  
  <p>inside a textchange event:</p>
  
  <pre><code>public void TextChangedEvent(object sender, EventArgs e)
      {
  </code></pre>
  
  <p>further more :</p>
  
  <p><img src="https://i.stack.imgur.com/0u1jC.png" alt="enter image description here"></p>
  
  <p>pls help how can i fix that error! thanks a lot!</p>