/////////////// test.d /////////////// import std.string; void main() { assert("".split(",").length == 0); } ////////////////////////////////////// Introduced in https://github.com/dlang/phobos/pull/4030. Additionally, the new behavior is inconsistent: split("") => [] split("", ",") => [""] splitLines("") => []
Example real-life scenarios: - Comma-delimited lists in program arguments or configuration files. The string variables will be empty unless populated, then split afterwards. - `libPaths ~= environment.get("LIBPATH", null).split(":")` will now search the current directory.
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d6572c2a44d69f449bfe2b07461b2f0a1d6503f9 Fix Issue 16587 - split("", "x") should be "" This reverts commit b438bf5a0653b616ef6debe2a0dfe247d8fc5928. https://github.com/dlang/phobos/commit/e3f842d52a3eedc7c8f6a5e75f26de05d5cf1fea Merge pull request #4836 from CyberShadow/pull-20161003-223010 Fix Issue 16587 - split("", "x") should be ""
Thanks, Vladimir!
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d6572c2a44d69f449bfe2b07461b2f0a1d6503f9 Fix Issue 16587 - split("", "x") should be "" https://github.com/dlang/phobos/commit/e3f842d52a3eedc7c8f6a5e75f26de05d5cf1fea Merge pull request #4836 from CyberShadow/pull-20161003-223010