diff --git a/text.py b/text.py index 678685b..b4fc968 100644 --- a/text.py +++ b/text.py @@ -90,5 +90,26 @@ class Log: return self.log +def asap(old: str, add: str, position: int): + """ + ASAP = Add String At Position + + (0 is the first character.) + """ + + return old[:position] + add + old[position:] + + +def rsap(old: str, add: str, position: int): + """ + RSAP = Replace String At Position + + (0 is the first character.) + """ + + return old[:position] + add + old[position + 1:] + + if __name__ == "__main__": example() + print(rsap("bfa", "l", 1))