1 s=“1234511” 2 n=2 3 print(s.replace('1', '*', n)) # *2345*1
【python】字符串replace方法替换前n个子串
猜你喜欢
转载自www.cnblogs.com/vivlalib/p/12544053.html
今日推荐
周排行