How to erase the comma in a calculator when the user has numbers such as 233,232 when they hit the 3 that is on the left of the comma
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5307129/how-to-handle-when-the-backspace-button-is-pressed-and-the-input-panel-has-digit">How to handle when the backspace button is pressed and the input panel has digit grouped numbers. E.g. 434,343,334.232.</a>  </p>
</blockquote>



<p>Basically the question says it all, I'm making a calculator in c# and I'm stuck on this problem. When digit grouping is hit the numbers get separated by commas, when the user hits the backspace button, the commas act like characters that get deleted.</p>

<p>inputPanelTextBox.Text = inputPanelTextBox.Text.Replace(",", "") I put this piece of code under my backspace click event. The problem is that say the panel has 234,232 and the user presses the backspace button, the comma is gone as well as the 2 on the far right.</p>

<p>What I want to happen is the same way the windows 7 calculator does when the digit grouped menu is checked and the user hits the backspace.</p>

<p>Any idea of how to go about this? Thank you so much in advance.</p>
