I can't understand why foreach loop produce every line by line, while it's fuctional analog print lines on one string:

foreach(f; file.byLine())
{
        writeln(f);
}

auto file = File("foo.txt","r");
file
.byLine()
.writeln;


file content:
-------------
first sring
second string
-------------

Output:
D:\code\JSONServer\source>app.exe
["first sring", "second string"]

expected:
first sring
second string

Reply via email to