fork download
  1. import std.stdio;
  2. import std.string;
  3.  
  4. void main()
  5. {
  6. auto x = "test \nsome lines\nout";
  7. foreach(int i, string line; x.byLine())
  8. writefln("%d: %s", i, line);
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.d(7): Error: undefined identifier module prog.byLine
prog.d(7): Error: function expected before (), not module prog.byLine of type void
prog.d(7): Error: foreach: int is not an aggregate type
stdout
Standard output is empty