📅  最后修改于: 2022-03-11 14:45:39.957000             🧑  作者: Mango
s = 'one two one two one'
print(s.replace('one', 'XXX'))
# Output -
# XXX two XXX two XXX
s = 'one two one two one'
print(s.replace('one', 'XXX', 2))
# 2 is the number of count
# Output -
# XXX two XXX two one