[thelist] java help

Peter Barrett peterb at corel.com
Wed Apr 18 10:10:07 CDT 2001


Something like this might work...

try{
    int foo =  Integer.parseInt(string);
    //print the integer
}catch(NumberFormatException e){
    // it can't be parsed into an int, so print it as a string
}

if this doesn't work, send me a piece of the code :)
~pete

sarah wrote:

> Where I'm having trouble majorly is
> converting data types. THe code already loops through
> and prints stuff, so all I need to do is the number
> check part.





More information about the thelist mailing list