[Issue 16587] New: split("", "x") should be ""

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Oct 3 15:08:54 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16587

          Issue ID: 16587
           Summary: split("", "x") should be ""
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: thecybershadow at gmail.com

/////////////// 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("")     => []

--


More information about the Digitalmars-d-bugs mailing list