Corrected something.
This commit is contained in:
parent
60271e4164
commit
aed66009a3
1 changed files with 1 additions and 1 deletions
2
text.py
2
text.py
|
@ -132,7 +132,7 @@ def find_nth_occurrence(string: str, substring: str, n: int):
|
||||||
else:
|
else:
|
||||||
rep = "b" * len(substring)
|
rep = "b" * len(substring)
|
||||||
|
|
||||||
return string.replace(substring, rep, n - 1).find(substring)
|
return string.replace(substring, rep, n).find(substring)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue