Skip to content

Commit ce03ae6

Browse files
Update replace.py
1 parent 19db3e3 commit ce03ae6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: strings/replace.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
def string_replace(
2-
text: str, input_string: str, replace_with_string: str, occurrence: int
3-
) -> str:
1+
def string_replace(text: str, input_string: str, replace_with_string: str, occurrence: int) -> str:
42
"""
3+
https://docs.python.org/3/library/stdtypes.html#str.replace
54
The replace() method replaces a specified string with another specified string.
6-
The occurence parameter can be skipped in order to consider all text.
5+
The occurrence parameter can be skipped in order to consider all text.
76
Note: input and replace_with strings are case-sensitive.
87
>>> text = "One Two Two Three Four Five"
98
>>> string_val = string_replace(text, "Two", "Seven", 1)
@@ -20,5 +19,4 @@ def string_replace(
2019

2120
if __name__ == "__main__":
2221
from doctest import testmod
23-
2422
testmod()

0 commit comments

Comments
 (0)