[Issue 14543] std.algorithm.searching.until does not handle range sentinels nicely
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Sep 14 22:33:53 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=14543
Paul Backus <snarwin+bugzilla at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |snarwin+bugzilla at gmail.com
--- Comment #2 from Paul Backus <snarwin+bugzilla at gmail.com> ---
It's possible to get the desired result here using `findSplit`:
---
void main()
{
import std.algorithm, std.range;
auto result = "one two three".findSplit("two").expand[0 .. $-1].chain;
assert(result.equal("one two"));
}
---
--
More information about the Digitalmars-d-bugs
mailing list