whatsthecodeforthat.com

What's the code for Replace Substring in python?

# Replace all occurrences of 'old'...
replaced = s.replace(old, new)

# ... or specify a limit.
replaced = s.replace(old, new, 2)