replace
Replaces all occurrences of a substring in a string with a replacement string.
replace(searchString, substring, replacement)Parameters#
searchString: Thestringto search withinsubstring: Thestringto find insearchStringreplacement: Thestringto replace for each match ofsubstring
Returns#
- The replaced
string
Example#
print(replace("Some dogs are funny. Some dogs are serious", 'dogs', 'cats'))# prints: Some cats are funny. Some cats are serious