code: public static CharSequence trimOws(CharSequence value) {
          final int length = value.length();
          if (length == 0) {
              return value;
          }
          int start = indexOfFirstNonOwsChar(value, length);
          int end = indexOfLastNonOwsChar(value, start, length);
          return start == 0 && end == length - 1 ? value : value.subSequence(start, end + 1);
      }
docs: Trim optional white-space characters from the specified value,
  according to <a href="https://tools.ietf.org/html/rfc7230#section-7">RFC-7230</a>.
  
  @param value the value to trim
  @return {@link CharSequence} the trimmed value if necessary, or the value unchanged