As in 2.x, use str.replace().
Example:
>>> ‘Hello world’.replace(‘world’, ‘Guido’)
‘Hello Guido’
replace() is a method of
>>> ‘hello, world’.replace(‘,’, ‘:’)
‘hello: world’
by James Palmer
As in 2.x, use str.replace().
Example:
>>> ‘Hello world’.replace(‘world’, ‘Guido’)
‘Hello Guido’
replace() is a method of
>>> ‘hello, world’.replace(‘,’, ‘:’)
‘hello: world’