<awangdev>65. Valid Number_1.java
public boolean isNumber(String s) {
        if (s == null) return false;
        s = s.trim();
        if (s.length() == 0) return false;
        int i = 0;
        char[] ss = s.toCharArray();
        if (ss[i] == '+' || ss[i] == '-') i++;
        boolean isNum = false, isDot = false, isExp = false;
        for (; i < s.length(); i++) {
            char c = ss[i];
            if (Character.isDigit(c)) isNum = true;
            else if (c == '.') {
                if (isDot || isExp) return false; 
                isDot = true;
            } else if (c == 'e') {
                if (isExp || !isNum) return false; 
                isExp = true;
                isNum = false; 
            } else if (c == '+' || c == '-') {
                if (i >= 1 && s.charAt(i - 1) != 'e') return false;
            } else return false; 
        }

        return isNum;
    }
public boolean var_0 ( String var_2 ) {
  if ( var_2 == null ) return false ;
  var_2 = var_2 . trim ( ) ;
  if ( var_2 . length ( ) == 0 ) return false ;
  int var_7 = 0 ;
  char [ ] var_9 = var_2 . toCharArray ( ) ;
  if ( var_9 [ var_7 ] == '+' || var_9 [ var_7 ] == '-' ) var_7 ++ ;
  boolean var_20 = false , var_17 = false , var_18 = false ;
  for ( ;
  var_7 < var_2 . length ( ) ;
  var_7 ++ ) {
    char var_13 = var_9 [ var_7 ] ;
    if ( Character . isDigit ( var_13 ) ) var_20 = true ;
    else if ( var_13 == '.' ) {
      if ( var_17 || var_18 ) return false ;
      var_17 = true ;
    }
    else if ( var_13 == 'e' ) {
      if ( var_18 || ! var_20 ) return false ;
      var_18 = true ;
      var_20 = false ;
    }
    else if ( var_13 == '+' || var_13 == '-' ) {
      if ( var_7 >= 1 && var_2 . charAt ( var_7 - 1 ) != 'e' ) return false ;
    }
    else return false ;
  }
  return var_20 ;
}
