title: How can I find the last character of a textbox text?
body: <p>I am a beginner in C#. I am making a web calculator like Microsoft Desktop calculator with the help of asp.net. But I'm stuck at one place. My code for Plus, minus, multiply or div is like:</p>
  
  <pre><code>protected void btnPlus_Click(object sender, EventArgs e)
  {
      if (txtBox1.Text.EndsWith("+"))
      {
          txtBox1.Text = txtBox1.Text;
      }
      else
      {
          txtBox1.Text = txtBox1.Text + "+";
          ViewState["Operation"] = "+";
      }
  }
  </code></pre>
  
  <p>But I want to check this condition for all operations like minus, multiply and divide. I don't want Plus, Minus, Multiply or Div signs appear in the textbox.</p>