def remove_suffix(text: str, suffix: str) -> str:
    """Removes the suffix from the string if it exists, and returns the result."""
    if suffix != "" and text.endswith(suffix):
        return text[:-len(suffix)]
    return text