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

On Python 3.x, the string.replace() is deprecated . What is the better approach for doing this?

1 Answer

0 votes
by (26.4k points)

In 2.x, You can use str.replace()

For example:

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

'Hello Guido'

Are you looking for a good python tutorial? Join the python course fast and gain more knowledge in python.

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

Related questions

0 votes
1 answer
asked Sep 20, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...