Check that a string only contains numbers
Posted on 2007-04-06
I have a text box that is used to enter commands into my application. One of these commands is to allow the user to select a new frequency. Frequencies are always entered in the format 1xx.xxx where each x represents a number only. The format for the command is '.freq1 1xx.xxx".
I split the string down to, what should be, a resulting two strings of three characters each. How do check that the user has only entered numbers? This is important otherwise I'll end up attempting to set the frequency incorrectly.