2018年3月31日

Python_48re模块的sub方法

摘要: sub是替换的功能 sub(模型,替换为的字符,目标原字符串,替换次数) import re yuanchuan='1qaz2wsx3edc4rfv5tgb' new_str=re.sub('\d','INTNUM',yuanchuan,2) #若果没有2表示默认替换所有的 print (new_s 阅读全文

posted @ 2018-03-31 17:51 JuGooLar 阅读(205) 评论(0) 推荐(0) 编辑

导航