python判断汉字数目

#检验是否含有中文字符
def isContainChinese(s):
	num=0
    for c in s:
        if ('\u4e00' <= c <= '\u9fa5'):
            num=num+1
    return num
 

你可能感兴趣的:(python)