D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8013 - splitter() and split() give different results
Summary: splitter() and split() give different results
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: monarchdodra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-01 17:37 UTC by bearophile_hugs
Modified: 2013-11-17 18:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2012-05-01 17:37:13 UTC
import std.stdio: writeln;
import std.string: split;
static import std.algorithm;
static import std.array;
void main() {
    auto s = " a message ";
    writeln(split(s));
    writeln(std.algorithm.splitter(s));
    writeln(std.array.splitter(s));
}


Output, DMD 2.060alpha:

["a", "message"]
["", "a", "message"]
["", "a", "message"]


Expected output:

["a", "message"]
["a", "message"]
["a", "message"]
Comment 1 monarchdodra 2012-10-22 13:49:14 UTC
Taking this too. Any other split-related bug I missed?
Comment 2 bearophile_hugs 2012-10-22 15:12:56 UTC
(In reply to comment #1)
> Taking this too. Any other split-related bug I missed?

I don't know what you have missed, but see also:

http://d.puremagic.com/issues/show_bug.cgi?id=4764
http://d.puremagic.com/issues/show_bug.cgi?id=5838
http://d.puremagic.com/issues/show_bug.cgi?id=6730
http://d.puremagic.com/issues/show_bug.cgi?id=7689