D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12865 - splitLines returns empty array on empty string
Summary: splitLines returns empty array on empty string
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-06 08:57 UTC by Temtaime
Modified: 2020-03-21 03:56 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 Temtaime 2014-06-06 08:57:25 UTC
std.string.splitLines(``) now returns [], but i expect it to return [ `` ]
Comment 1 Robert Schadek 2014-09-11 11:32:46 UTC
why? empty given you empty makes sense to me?
Comment 2 basile-z 2015-11-21 14:40:53 UTC
No your wrong Temtaime,because [``] as result would mean that the input argument contained one empty string:


_______________
import std.string;

void main()
{
    assert( splitLines("\n") == [``]); // ok
}
_______________