用正则中的re.sub方法。
# re.sub(pattern, replaced, string)
import re
re.sub(“\d”,"",string)
# 将字符串中的数字都去掉
用正则中的re.sub方法。
# re.sub(pattern, replaced, string)
import re
re.sub(“\d”,"",string)
# 将字符串中的数字都去掉
转载于:https://www.cnblogs.com/everfight/p/re_sub.html