主页
Python
Python String replace() 方法
demo_ref_string_replace3
运行 ❯
×
更改方向
保存代码
更改主题
txt = "one one was a race horse, two two was one too." x = txt.replace("one", "three", 2) print(x)
three three was a race horse, two two was one too."