中文编码范围为\u4e00-\u9fff; 去除中文可用如下方法;
def clean(s):
import re
return re.sub('[\u4e00-\u9fff]', '/', s)
判断是否包含中文
def is_chinese(text):
"""判断是否包含中文"""
for c in text:
if c >= u'\u4e00' and c <= u'\u9fa5':
return True
return False
1900

被折叠的 条评论
为什么被折叠?



