def case_insensitive_equals(name1: str, name2: str) -> bool:
    """
    Convenience method to check whether two strings match, irrespective of their case and any surrounding whitespace.
    """
    return name1.strip().lower() == name2.strip().lower()