Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

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

1 Answer

0 votes
by (106k 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:-

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...