I’ve looked all over the place, but it seems that examples I have seen allow only numbers 0-9
I’m writing a Pythagorean Theorem program. I wish to have the phone (Windows Phone 7) check if there are ANY alpha (A-Z, a-z), symbols (@,%), or anything other than a number in the textbox. If not, then it will continue computing. I want to check so there will be no future errors.
This is basically a bad pseudocode of what I want it to do
txtOne–>any alpha?–No–>any symbols–No–>continue…
I would actually prefer a command to check if the string is completely a number.
Thanks in advance!
There are several ways to do this:
You can use
TryParse()and check if the return value is not false.You can use
Regexto validate: