def _next_unquoted_char(text: str, chs: str, startidx: int = 0) -> int:
    """Return position of next unquoted character in tuple, or -1 if not found.
    
    It is always assumed that the first character being checked is not already
    inside quotes.
    """
    i = startidx
    in_quotes = False
    if chs is None:
        chs = string.whitespace
    while i < len(text):
        if text[i] == '"' and not _is_character_escaped(text, i):
            in_quotes = not in_quotes
        if not in_quotes:
            if text[i] in chs:
                return i
        i += 1
    return -1
Return position of next unquoted character in tuple, or -1 if not found.

It is always assumed that the first character being checked is not already
inside quotes.
prometheus_client/parser.py