from typing import AnyStr


def detect_space_after(txt: AnyStr, end: int):
    """Given text and an end index returns True if there is a space after the end index, false
    otherwise.

    Parameters
    ----------
    txt : str
        the text itself.
    end : int
        the end index of the token.

    Returns
    -------
    bool
        true if there is a space after the end index, false otherwise.
    """
    return end < len(txt) and not txt[end:end + 1].isspace()