用正则中的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)
# 将字符串中的数字都去掉
相关文章: