Skip to content

Commit

Permalink
新增 is_string_and_not_empty 方法不存在的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
liufei-ereach committed May 19, 2024
1 parent 29e074f commit caf2dce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/utils/string_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit caf2dce

Please sign in to comment.