static public boolean containsOnlyDigits ( String string0 ) { // are they all digits? for ( int i = 0 ; i < string0 . length ( ) ; i ++ ) { if ( ! Character . isDigit ( string0 . charAt ( i ) ) ) { return false ; } } return true ; }
Checks if a string contains only digits .