split

Simpler variant of Phobos' split.

split
(
alias pred
R
)
if (
isForwardRange!R
)

Examples

import std.ascii: isDigit;
assert(`aa1bb`.split!(a => a.isDigit) == tuple(`aa`, `1`, `bb`));
assert(`aa1`.split!(a => a.isDigit) == tuple(`aa`, `1`, ``));
assert(`1bb`.split!(a => a.isDigit) == tuple(``, `1`, `bb`));

Meta