Join Nostr
2023-05-04 01:38:55 UTC
in reply to

ID-Hub on Nostr: # 定义一个函数,检查字符串中是否包含中文字符 def ...

# 定义一个函数,检查字符串中是否包含中文字符
def contains_chinese(s):
for ch in s:
if u'\u4e00' <= ch <= u'\u9fff':
return True
return False

这个判断字符串中是否包含中文字符的算法,会把日文看成中文😂