fix plugin

This commit is contained in:
jxxghp
2023-09-07 17:40:09 +08:00
parent f694dee71d
commit 4e26168ab5
2 changed files with 571 additions and 4 deletions

View File

@ -641,3 +641,16 @@ class StringUtils:
formatted_string = "".join(formatted_ranges)
return formatted_string
@staticmethod
def is_number(text: str) -> bool:
"""
判断字符是否为可以转换为整数或者浮点数
"""
if not text:
return False
try:
float(text)
return True
except ValueError:
return False