vendredi 3 août 2018

How to check last character is (.) then do nothing. After having value then only can put 1 (.)?

Explanation is when if the last input is (.) then i can't keep pressing the (.)button, else if there's value then i can only press (.)button.

This is my code.

 string input = "";

            if (input.EndsWith("."))
            {

            }
            else
            {
                lblExpression.Text = lblExpression.Text + Decimal.Text;
            }

Is there any logic wrong with me?

Aucun commentaire:

Enregistrer un commentaire