D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3340 - std.string.split(S1 s, S2 delim) still doesn't work for char[].
Summary: std.string.split(S1 s, S2 delim) still doesn't work for char[].
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: Andrei Alexandrescu
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-09-22 10:38 UTC by David Simcha
Modified: 2015-06-09 01:26 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2009-09-22 10:38:35 UTC
The following line appears twice in the function:

words[wordi] = "";

Since "" is considered immutable, it can't be put in an array of char[]s.  This can be fixed by changing this line to:

words[wordi] = null;

Null is equivalent, for all practical purposes, to "", but is automatically coerced to the right type.
Comment 1 Walter Bright 2009-10-06 02:23:14 UTC
Fixed dmd 2.033