MCPcopy Index your code
hub / github.com/RustPython/RustPython / replace

Function replace

Lib/pydoc.py:263–268  ·  view source on GitHub ↗

Do a series of global replacements on a string.

(text, *pairs)

Source from the content-addressed store, hash-verified

261 inspect.istraceback(object) or inspect.iscode(object))
262
263def replace(text, *pairs):
264 """Do a series of global replacements on a string."""
265 while pairs:
266 text = pairs[1].join(text.split(pairs[0]))
267 pairs = pairs[2:]
268 return text
269
270def cram(text, maxlen):
271 """Omit part of a string if needed to make it fit in a maximum length."""

Callers 4

escapeMethod · 0.70
repr_stringMethod · 0.70
preformatMethod · 0.70
repr_stringMethod · 0.70

Calls 2

joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected