【python】字符串replace方法替换前n个子串

1 s=“12345112 n=2
3 print(s.replace('1', '*', n))  # *2345*1
posted @ 2020-03-22 09:05  非正常人类样本  阅读(1923)  评论(0)    收藏  举报