/** * 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 */ 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); }
/** * 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 */ 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); }
/** * 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 */ 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); }
int last; if (trimWhiteSpace) { start = indexOfFirstNonOwsChar(value, length); last = indexOfLastNonOwsChar(value, start, length); } else {
int last; if (trimWhiteSpace) { start = indexOfFirstNonOwsChar(value, length); last = indexOfLastNonOwsChar(value, start, length); } else {
int last; if (trimWhiteSpace) { start = indexOfFirstNonOwsChar(value, length); last = indexOfLastNonOwsChar(value, start, length); } else {
/** * 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 */ 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); }
int last; if (trimWhiteSpace) { start = indexOfFirstNonOwsChar(value, length); last = indexOfLastNonOwsChar(value, start, length); } else {
/** * 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 */ 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); }
/** * 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 */ 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); }
/** * 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 */ 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); }
int last; if (trimWhiteSpace) { start = indexOfFirstNonOwsChar(value, length); last = indexOfLastNonOwsChar(value, start, length); } else {
int last; if (trimWhiteSpace) { start = indexOfFirstNonOwsChar(value, length); last = indexOfLastNonOwsChar(value, start, length); } else {
int last; if (trimWhiteSpace) { start = indexOfFirstNonOwsChar(value, length); last = indexOfLastNonOwsChar(value, start, length); } else {