MCPcopy Create free account
hub / github.com/geekcomputers/Python / replacetext

Function replacetext

replacetext.py:14–28  ·  view source on GitHub ↗

Replace spaces in a string with hyphens. Parameters ---------- text : str Input string. Returns ------- str String with spaces replaced by '-'.

(text: str)

Source from the content-addressed store, hash-verified

12
13
14def replacetext(text: str) -> str:
15 """
16 Replace spaces in a string with hyphens.
17
18 Parameters
19 ----------
20 text : str
21 Input string.
22
23 Returns
24 -------
25 str
26 String with spaces replaced by '-'.
27 """
28 return text.replace(" ", "-")
29
30
31if __name__ == "__main__":

Callers 1

replacetext.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected