6 lines
204 B
Python
6 lines
204 B
Python
def str_is_empty(s: str) -> bool:
|
||
"""Check if a string is empty or contains only whitespace."""
|
||
if s is None:
|
||
return True
|
||
stripped = s.replace(" ", " ")
|
||
return not bool(stripped) |