split_by_order#

split_by_order(s: str, separators: Iterable[str], keep: bool = True) List[str][source]#

Split string by a list of substrings, each used once as a separator.

Parameters
sstr

the string to split

separatorst.Iterable[str]

list of substrings to split by

keepbool , default: True

whether to keep the separators in list as well. Default is True.

Returns
——-
t.List[str]

list of substrings