Files
surugaya/app/utils/app_utils.py
T
2026-06-08 16:09:13 +08:00

9 lines
284 B
Python

def is_valid_str(s):
"""判断字符串是否有效,即非空且非空格。"""
return isinstance(s, str) and len(s.strip()) > 0
def is_empty_str(s):
"""判断字符串是否为空,即空或仅包含空格。"""
return isinstance(s, str) and len(s.strip()) == 0