D Documentation  
opApply
int opApply(int delegate(inout char[] line) dg);
int opApply(int delegate(inout ulong n, inout char[] line) dg);
int opApply(int delegate(inout wchar[] line) dg);
int opApply(int delegate(inout ulong n, inout wchar[] line) dg);


This operator (for the foreach statement) iterates through the stream line-by-line.
Breaking the foreach loop will leave the Stream at the position after line last read.
The string storing the line may be reused in each iteration of the loop.

For example:
Stream file = new BufferedFile("sample.txt");
foreach(ulong n, char[] line; file) {
  stdout.writefln("line %d: %s",n,line);
}
file.close();

Created using PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.