public CharSequence takeUntil(char until) throws StringTagParseException {
    until = Character.toLowerCase(until);
    int endIdx = -1;
    for (int idx = this.index; idx < this.sequence.length(); ++idx) {
      if (this.sequence.charAt(idx) == Tokens.ESCAPE_MARKER) {
        idx++;
      } else if (Character.toLowerCase(this.sequence.charAt(idx)) == until) {
        endIdx = idx;
        break;
      }
    }
    if (endIdx == -1) {
      throw this.makeError("No occurrence of " + until + " was found");
    }

    final CharSequence result = this.sequence.subSequence(this.index, endIdx);
    this.index = endIdx + 1;
    return result;
  }
Search for the provided token, and advance the reader index past the {@code until} character.

@param until case-insensitive token
@return the string starting at the current position (inclusive) and going until the location of {@code until}, exclusive
@throws StringTagParseException if {@code until} is not present in the remaining string
nbt/src/main/java/net/kyori/adventure/nbt/CharBuffer.java