Can you read the next line while iterating over byLine?

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 2 10:58:46 PST 2017


Even this one could works:

import std.stdio;

void main(string[] args)
{
    auto range = File("text.txt").byLine();

    foreach (line; range)

    {
        if (line != "")
        {
            writeln(line);
            range.popFront;
            char[] url = range.front().dup;
            range.popFront;
            char[] num = range.front().dup
        }
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20170202/0f138735/attachment.html>


More information about the Digitalmars-d-learn mailing list