Init
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user