title: C# - Remove last character from string on keydown
body: <p>I'm using this at the moment to remove the last character of my string if the back key is pressed, however if I hold the key it isn't removing characters from the string, while the rest of the conditionals work fine adding characters to the string. I suppose that the Remove function don't work well on a kind of loop.</p>
  
  <pre><code>if (key == Keys.Back)
  {
      if (text.Length &gt; 0)
      {
          text.Remove(text.Length - 1);
      }
  }
  </code></pre>
  
  <p><strong>Update</strong>: I thought that it was removing characters on key press, but <strong>it didn't.</strong> Thanks for the answers of this stupid error.</p>