如何在Python3.x中使用string.replace()

python 3.x上不推荐使用string.replace()。做这件事的新方法是什么

与2.x中一样,使用str.replace()

例如:

&gt&燃气轮机>'Hello world'.replace('world','Guido')
“你好,圭多”

发表评论