diff --git a/app/utils/string_utils.py b/app/utils/string_utils.py index 5249976..a32ea96 100644 --- a/app/utils/string_utils.py +++ b/app/utils/string_utils.py @@ -574,3 +574,13 @@ def is_chinese_word(string: str, mode: int = 1): if re.search(pattern="^[0-9]+$", string=string): return True return False + + @staticmethod + def is_string_and_not_empty(word): + """ + 判断是否是字符串并且字符串是否为空 + """ + if isinstance(word, str) and word.strip(): + return True + else: + return False \ No newline at end of file