public static boolean isDecString(final String string){
  Preconditions.checkNotNull(string);
  final CharMatcher cm=CharMatcher.inRange('0','9');
  for (int i=0; i < string.length(); i++) {
    if (!cm.apply(string.charAt(i))) {
      return false;
    }
  }
  return string.length() != 0;
}

public static boolean isDecString ( final String string ) { Preconditions . checkNotNull ( string ) ; final CharMatcher cm = CharMatcher . inRange ( '0' , '9' ) ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { if ( ! cm . apply ( string . charAt ( i ) ) ) { return false ; } } return string . length ( ) != 0 ; }
tests whether a given string is a valid decimal string .
