MCPcopy Create free account
hub / github.com/ipython/ipython / num_ini_spaces

Function num_ini_spaces

IPython/utils/text.py:339–346  ·  view source on GitHub ↗

Return the number of initial spaces in a string

(strng)

Source from the content-addressed store, hash-verified

337ini_spaces_re = re.compile(r'^(\s+)')
338
339def num_ini_spaces(strng):
340 """Return the number of initial spaces in a string"""
341
342 ini_spaces = ini_spaces_re.match(strng)
343 if ini_spaces:
344 return ini_spaces.end()
345 else:
346 return 0
347
348
349def format_screen(strng):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected