Test if char is '0'-'9' [migrated]
- by Chris Okyen
My Java code is
// if the first character is not 0-9
if(
(((input.substring(0,0)).compareTo("1")) < 0 || (((input.substring(0,0)).compareTo("9")) < 0));
{
System.out.println("Error: The first digit of the temperature is not 1-9. Force Exiting Program. ");
System.exit(1); // exit the program
}
But it…