comefrom: <qiyuangong>844_Backspace_String_Compare_2.java
code: private String trans(String str) {
          StringBuilder sb = new StringBuilder();
          for (char c : str.toCharArray()) {
              if (c != '#') { sb.append(c); } // if not '#', append it at the end of sb.
              else if (sb.length() > 0) { sb.deleteCharAt(sb.length() - 1); } // remove last char in sb, if sb is not empty.
          }
          return sb.toString();
      }
masked: private String var_0 ( String var_2 ) {
    StringBuilder var_4 = new StringBuilder ( ) ;
    for ( char var_6 : var_2 . toCharArray ( ) ) {
      if ( var_6 != '#' ) {
        var_4 . append ( var_6 ) ;
      }
      else if ( var_4 . length ( ) > 0 ) {
        var_4 . deleteCharAt ( var_4 . length ( ) - 1 ) ;
      }
    }
    return var_4 . toString ( ) ;
  }
  