MCPcopy
hub / github.com/pyrevitlabs/pyRevit / split

Method split

site-packages/pyparsing.py:1781–1801  ·  view source on GitHub ↗

Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be

(self, instring, maxsplit=_MAX_INT, includeSeparators=False)

Source from the content-addressed store, hash-verified

1779 raise exc
1780
1781 def split(self, instring, maxsplit=_MAX_INT, includeSeparators=False):
1782 """
1783 Generator method to split a string using the given expression as a separator.
1784 May be called with optional C{maxsplit} argument, to limit the number of splits;
1785 and the optional C{includeSeparators} argument (default=C{False}), if the separating
1786 matching text should be included in the split results.
1787
1788 Example::
1789 punc = oneOf(list(".,;:/-!?"))
1790 print(list(punc.split("This, this?, this sentence, is badly punctuated!")))
1791 prints::
1792 ['This', ' this', '', ' this sentence', ' is badly punctuated', '']
1793 """
1794 splits = 0
1795 last = 0
1796 for t,s,e in self.scanString(instring, maxMatches=maxsplit):
1797 yield instring[last:s]
1798 if includeSeparators:
1799 yield t[0]
1800 last = e
1801 yield instring[last:]
1802
1803 def __add__(self, other ):
1804 """

Callers 15

set_verFunction · 0.80
find_todosMethod · 0.80
_find_changesFunction · 0.80
format_helpFunction · 0.80
extract_namespacesFunction · 0.80
_normalize_tagMethod · 0.80
text_totitleFunction · 0.80
create_parameter_valueFunction · 0.80
extract_patdefsFunction · 0.80
make_fillgridFunction · 0.80
_pick_parentMethod · 0.80

Calls 1

scanStringMethod · 0.95

Tested by 9

__init__Method · 0.64
server_nameMethod · 0.64
server_portMethod · 0.64
resolve_redirectMethod · 0.64
openMethod · 0.64
test_read_shortMethod · 0.64
test_read_multiMethod · 0.64
test_read_with_blanksMethod · 0.64
test_read_semi_sepMethod · 0.64