title: How remove characters minus (-) in middle or end in string c#
body: <p>I want delete one character minus <code>-</code> that the user press in a textbox. I validate that the user has not pressed the minus key twice with event <code>key_press</code>:</p>
  
  <pre><code>if (!char.IsControl(e.KeyChar) &amp;&amp; !char.IsDigit(e.KeyChar) &amp;&amp; (e.KeyChar != '.') &amp;&amp; (e.KeyChar != '-'))
  {
       e.Handled = true;
  }
  
   // only allow one minus -
  
  if (e.KeyChar == '-' &amp;&amp; ((sender as TextBox).Text.IndexOf('-') &gt; -1))
  {
       e.Handled = true;
  }
  </code></pre>
  
  <p>the problem is when the user presses the minus sign key in middle or end of the string.  For example:</p>
  
  <p>1000.-00 &lt;--- Invalid</p>
  
  <p>2000.00- &lt;--- Invalid</p>
  
  <p>-1000.00 &lt;--- valid</p>
  
  <p>How can I ensure the minus sign is beginning the contents of the text box?</p>