MCPcopy Index your code
hub / github.com/python/cpython / prepstr

Function prepstr

Lib/idlelib/editor.py:1622–1636  ·  view source on GitHub ↗

Extract the underscore from a string. For example, prepstr("Co_py") returns (2, "Copy"). Args: s: String with underscore. Returns: Tuple of (position of underscore, string without underscore).

(s)

Source from the content-addressed store, hash-verified

1620
1621
1622def prepstr(s):
1623 """Extract the underscore from a string.
1624
1625 For example, prepstr("Co_py") returns (2, "Copy").
1626
1627 Args:
1628 s: String with underscore.
1629
1630 Returns:
1631 Tuple of (position of underscore, string without underscore).
1632 """
1633 i = s.find('_')
1634 if i >= 0:
1635 s = s[:i] + s[i+1:]
1636 return i, s
1637
1638
1639keynames = {

Callers 3

createmenubarMethod · 0.85
ApplyKeybindingsMethod · 0.85
fill_menusMethod · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…