consider using the splitter(r) overload.
Parameters
pred | The predicate for comparing each element with the separator, defaulting to "a == b". |
r | The input range to be split. Must support slicing and .length or be a narrow string type. |
s | The element (or range) to be treated as the separator between range segments to be split. |
keepSeparators | The flag for deciding if the separators are kept Constraints: The predicate pred needs to accept an element of r and the separator s. |
Returns
r
is a forward range or bidirectional range, the returned range will be likewise. When a range is used a separator, bidirectionality isn't possible.
If keepSeparators is equal to Yes.keepSeparators the output will also contain the separators.
If an empty range is given, the result is an empty range. If a range with one separator is given, the result is a range with two empty elements.