Is there a way to check a variable/string if it has characters with anything other than numbers?
Reason I ask, I have an edit text control that only expects numbers and dashes "-" and if you fatfinger, or purposely type characters in the box, itll crash the app as I am dealing with it numerically.
Of course, I strip the "-" out of the variable before processing it as a number.
You could also limit the characters the user can enter.
With EditText1.InputType = EditText1.INPUT_TYPE_NUMBERS
or EditText1.InputType = EditText1.INPUT_TYPE_DECIMAL_NUMBERS
You can also have a look at the IME library which allows to define specific limitations.