MCPcopy Create free account
hub / github.com/bugy/script-server / replace

Function replace

src/utils/string_utils.py:1–9  ·  view source on GitHub ↗
(old_text, new_text, start, end)

Source from the content-addressed store, hash-verified

1def replace(old_text, new_text, start, end):
2 start_text = old_text[:start]
3
4 if end < (len(old_text) - 1):
5 end_text = old_text[end + 1:]
6 else:
7 end_text = ''
8
9 return start_text + new_text + end_text
10
11
12def is_integer(text):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected