obviously there's 'better' ways of doing this, but use it an a contrived example: string inputpath = "/a/b"; auto parts = splitter(inputpath, "/"); // parts is ["", "a", "b"] parts.popFront; // get rid of empty leading part auto file = parts.back; parts.popBack; writefln("file = %s", file); auto path = reduce!(q{a ~= "/" ~ b})("", parts); writefln("path = %s", path); Problem: Splitter is strictly a forward range currently.
Fixed SVN.