On Friday, 11 May 2012 at 20:40:23 UTC, Paul wrote:
On Friday, 11 May 2012 at 18:02:54 UTC, Jesse Phillips wrote:
void main() {
    foreach(line; readText("file.in").splitLines()) ...
}

Thanks Jesse.
I'm finding that I can't just substitute args[1] for a text string. Is there a clever way to use args[] in place of your "file.in"?

Why not?

void main(string[] args) {
    if(args.length > 1) {
        foreach(line; readText(args[1]).splitLines()) ...
    }
}

Reply via email to