code: String trim(String string) {
          BaseFont ft = font.getFont();
          if (ft.getFontType() == BaseFont.FONT_TYPE_CJK && ft.getUnicodeEquivalent(' ') != ' ') {
              while (string.endsWith("\u0001")) {
                  string = string.substring(0, string.length() - 1);
              }
          }
          else {
              while (string.endsWith(" ") || string.endsWith("\t")) {
                  string = string.substring(0, string.length() - 1);
              }
          }
          return string;
      }
docs: Removes all the <VAR>' '</VAR> and <VAR>'-'</VAR>-characters on the right of a <CODE>String</CODE>.
  <P>
  @param	string		the <CODE>String<CODE> that has to be trimmed.
  @return	the trimmed <CODE>String</CODE>