MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / replace

Function replace

tools/python-3.11.9-amd64/Lib/pydoc.py:226–231  ·  view source on GitHub ↗

Do a series of global replacements on a string.

(text, *pairs)

Source from the content-addressed store, hash-verified

224 inspect.istraceback(object) or inspect.iscode(object))
225
226def replace(text, *pairs):
227 """Do a series of global replacements on a string."""
228 while pairs:
229 text = pairs[1].join(text.split(pairs[0]))
230 pairs = pairs[2:]
231 return text
232
233def cram(text, maxlen):
234 """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