code: private static String trim( StringBuilder builder ) {
          String str = builder.toString().trim();
          builder.setLength( 0 );
          return str;
      }
docs: Get a trim string from the builder and clear the builder.
  
  @param builder
  the builder.
  @return a trim string