protected String rtrim(String s){
  if ((s == null) || (s.length() == 0)) {
    return s;
  }
  int pos=s.length();
  while ((pos > 0) && Character.isWhitespace(s.charAt(pos - 1))) {
    --pos;
  }
  return s.substring(0,pos);
}

protected String rtrim ( String s ) { if ( ( s == null ) || ( s . length ( ) == 0 ) ) { return s ; } int pos = s . length ( ) ; while ( ( pos > 0 ) && Character . isWhitespace ( s . charAt ( pos - 1 ) ) ) { -- pos ; } return s . substring ( 0 , pos ) ; }
remove the trailing whitespace from the specified string .
