splitBefore

Simpler variant of Phobos' splitBefore.

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

Examples

import std.algorithm.comparison : equal;
import std.ascii: isDigit;
assert(`11ab`.splitBefore!(a => !a.isDigit) == tuple(`11`, `ab`));
assert(`ab`.splitBefore!(a => !a.isDigit) == tuple(``, `ab`));

Meta