<gouthampradhan>string_ValidWordAbbreviation_1.java
public boolean validWordAbbreviation(String word, String abbr) {
    if (abbr.length() > word.length()) return false;
    StringBuilder num = new StringBuilder();
    int j = 0;
    for (int i = 0; i < abbr.length() && j < word.length(); i++) {
      char curr = abbr.charAt(i);
      if (curr == '0' && num.toString().isEmpty()) return false;
      if (curr >= '0' && curr <= '9') {
        num.append(curr);
      } else {
        if (num.toString().isEmpty()) {
          if (word.charAt(j) != abbr.charAt(i)) {
            return false;
          }
          j++;
        } else {
          int next = Integer.parseInt(num.toString());
          j += next;
          if (word.length() <= j) {
            return false;
          }
          if (word.charAt(j) != abbr.charAt(i)) {
            return false;
          }
          num = new StringBuilder();
          j++;
        }
      }
    }
    if (!num.toString().isEmpty()) {
      int next = Integer.parseInt(num.toString());
      j += next;
      if (j > word.length() || j < word.length()) {
        return false;
      }
    }
    return true;
  }
public boolean var_0 ( String var_2 , String var_3 ) {
  if ( var_3 . length ( ) > var_2 . length ( ) ) return false ;
  StringBuilder var_6 = new StringBuilder ( ) ;
  int var_8 = 0 ;
  for ( int var_9 = 0 ;
  var_9 < var_3 . length ( ) && var_8 < var_2 . length ( ) ;
  var_9 ++ ) {
    char var_11 = var_3 . charAt ( var_9 ) ;
    if ( var_11 == '0' && var_6 . toString ( ) . isEmpty ( ) ) return false ;
    if ( var_11 >= '0' && var_11 <= '9' ) {
      var_6 . append ( var_11 ) ;
    }
    else {
      if ( var_6 . toString ( ) . isEmpty ( ) ) {
        if ( var_2 . charAt ( var_8 ) != var_3 . charAt ( var_9 ) ) {
          return false ;
        }
        var_8 ++ ;
      }
      else {
        int var_19 = Integer . parseInt ( var_6 . toString ( ) ) ;
        var_8 += var_19 ;
        if ( var_2 . length ( ) <= var_8 ) {
          return false ;
        }
        if ( var_2 . charAt ( var_8 ) != var_3 . charAt ( var_9 ) ) {
          return false ;
        }
        var_6 = new StringBuilder ( ) ;
        var_8 ++ ;
      }
    }
  }
  if ( ! var_6 . toString ( ) . isEmpty ( ) ) {
    int var_19 = Integer . parseInt ( var_6 . toString ( ) ) ;
    var_8 += var_19 ;
    if ( var_8 > var_2 . length ( ) || var_8 < var_2 . length ( ) ) {
      return false ;
    }
  }
  return true ;
}
