From aed66009a3b93edaac50a7b729196c24d4de03b8 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Mon, 25 Mar 2024 14:25:05 +0100 Subject: [PATCH] Corrected something. --- text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text.py b/text.py index 4ca69fd..05b8f09 100644 --- a/text.py +++ b/text.py @@ -132,7 +132,7 @@ def find_nth_occurrence(string: str, substring: str, n: int): else: rep = "b" * len(substring) - return string.replace(substring, rep, n - 1).find(substring) + return string.replace(substring, rep, n).find(substring) if __name__ == "__main__":