code: public static String trimBy(final StringBuilder s, final int left, final int right) {
          return s.substring(left, s.length() - right);
      }
docs: Remove the given number of chars from start and end.
  There is no parameter checking, the caller has to take care of this.
  
  @param s the StringBuilder
  @param left no of chars to be removed from start
  @param right no of chars to be removed from end
  @return the trimmed string