def strip_from_end(text, suffix):
    """
    Strip a substring from the end of a string

    Parameters
    ----------
    text : str
        The string to be evaluated

    suffix : str
        The suffix or substring to remove from the end of the text string

    Returns
    -------
    str
        A string with the substring removed if it was found at the end of the
        string.
    """
    if not text.endswith(suffix):
        return text
    return text[:len(text)-len(suffix)]