0 votes
1 view
in Python by (31.7k points)

The string.replace() is deprecated in python 3.x. What is the new way of doing this?

1 Answer

0 votes
by (75.1k points)

You can use str.replace().

Example:

>>> 'Hello world'.replace('world', 'Guido') 

'Hello Guido'

To know more about this you can have a look at the following video tutorial:-

...