关于 string 的 replace 方法,需要注意 replace 不会改变原 string 的内容。实例: temp_str = 'this is a test'print(temp_str.replace('is','IS'))print(temp_str) 结果为: thIS IS a test this is a test