code: public static Slice rightTrim(Slice utf8)
      {
          int position = lastNonWhitespacePosition(utf8, 0);
          return utf8.slice(0, position);
      }
docs: Removes all white space characters from the right side of the string.
  <p>
  Note: Invalid UTF-8 sequences are not trimmed.