public static boolean isNumeric ( String string ) { if ( string == null || string . length ( ) == 0 ) return false ; int l = string . length ( ) ; for ( int i = 0 ; i < l ; i ++ ) { if ( ! Character . isDigit ( string . codePointAt ( i ) ) ) return false ; } return true ; }
Tests if a string is numeric i . e . contains only digit characters