str.replace
Copy of source with one occurrence of target replaced: occurrence 0 is the first, 1 the second (default 0). Unchanged when there is no such occurrence.
str.replace(source: string, target: string, replacement: string, occurrence: int = 0) -> string
Parameters
sourcestring: The text; na gives na.targetstring: The text to look for; "" changes nothing.replacementstring: What it is replaced with; na counts as "".occurrenceint: Which occurrence: 0 is the first (default), 1 the second; past the last nothing changes.
Example
s = str.replace("1-2-3", "-", "/", 1)