Python Function Reference

replace
Return a copy of the string with all occurrences of substring old replaced by new.
Python 3.13
str.replace(old, new, count=-1)
old
The old substring to be replaced.
new
The new substring.
count
How many occurrences to replace.
Examples
Python 3.13
>>> 'hello world'.replace('world', 'Python')
'hello Python'