Bug 12865 – splitLines returns empty array on empty string

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-06T08:57:25Z
Last change time
2020-03-21T03:56:32Z
Assigned to
No Owner
Creator
Temtaime

Comments

Comment #0 by temtaime — 2014-06-06T08:57:25Z
std.string.splitLines(``) now returns [], but i expect it to return [ `` ]
Comment #1 by rburners — 2014-09-11T11:32:46Z
why? empty given you empty makes sense to me?
Comment #2 by b2.temp — 2015-11-21T14:40:53Z
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 } _______________