def remove_suffix(string, suffix):
    """Strip the given suffix from a string.

    Unlike the builtin string rstrip method the suffix is treated as a
    string, not a character set. Only an exact match triggers a
    removal, and the suffix is only removed once.

    Examples:

        remove_suffix('azaz', 'az') -> 'az'
        remove_suffix('az', 'za') -> 'az'
    """
    if string.endswith(suffix):
        return string[:-len(suffix)]
    return string