public static int skipContentsUntil(String args, int startIndex, int len, char... endChars) {
        int charLen = endChars != null ? endChars.length : 0;
        if (charLen == 0) {
            endChars = new char[] { '\0' };
            charLen = 1;
        }
        for (int i = startIndex; i < len; i++) {
            char ch = args.charAt(i);
            for (int j = 0; j < charLen; j++) {
                if (ch == endChars[j]) {
                    return i + 1;
                }
            }

            if (isQuote(ch)) {
                i = skipQuotedString(args, i, len, ch) - 1;
            } else if (isOpenBracket(ch)) {
                i = skipBrackets(args, i, len, ch) - 1;
            } else if ((ch == '-' || ch == '/') && i + 1 < len) {
                char nextCh = args.charAt(i + 1);
                if (ch == '-' && nextCh == '-') {
                    i = skipSingleLineComment(args, i + 2, len) - 1;
                } else if (ch == '/' && nextCh == '*') {
                    i = skipMultiLineComment(args, i + 2, len) - 1;
                }
            }
        }

        return len;
    }
Skip quoted string, comments, and brackets until seeing one of
{@code endChars} or reaching end of the given string.

@param args       non-null string to scan
@param startIndex start index
@param len        end index, usually length of the given string
@param endChars   skip characters until seeing one of the specified
                  characters or reaching end of the string; '\0' is used when
                  it's null or empty
@return index of {@code endChar} or {@code len}
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseUtils.java