try{
Integer.parseInt(string);
return true;
}catch (Exception e){
return false;
}
or you can do it himself:
for ( int i = 0; i < string.length; ++i ) {
if ( !( string[i] >= '0' || string[i] <= '9' ) )
return false;
}
return true;
Of course is also function isDigit