Function
string.replace

Signature

replace(s, old, new, maxsplit=-1)

Documentation String

replace (str, old, new[, maxsplit]) -> string

Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxsplit is given, only the first maxsplit occurrences are replaced.