python 检查是否为中文字符串的方法
【目标需求】 查看某一个字符串是否为中文字符串 【解决办法】 def check_contain_chinese(check_str): for ch in check_str: if u'\u4e00' <= ch <= u'\u9fff': return True else: return False 【举例检验】 check_contain_chinese('abcc') False check_contain_chinese('123') False check_contain_chinese('中文') True 问题解决! —————–2018-07-
下载地址
用户评论