def str_bool(value):
    """
    Convert string to boolean.

        >>> str_bool("0")
        False
        >>> str_bool("1")
        True
        >>> str_bool("true")
        True
        >>> str_bool("false")
        False
    """
    if isinstance(value, str):
        value = value.strip()
        if value.lower() in ("0", "false"):
            return False
    return bool(value)