代码示例:(标识:python_string_replace)
python_string_replace.py
a = "Hello, World!"
print(a.replace("World", "Kitty"))
运行结果: