As of recent observation the `line` in the previous implementation seem to recognise **\r** as default terminator. Making `writeln("|" ~ line ~ "|");` not possible.

By correcting terminator and disabling it on `byLine` function it is possible to achieve following output to standard stream:

**Output**
```
|test|
| s|
| |
|   HelloWorld|
^This Line is here.
|t|
|ff|
```

**Input (example.txt)**
```
test
 s

   HelloWorld
t
ff
```

**Source code**
```
import std;

void main(){

foreach (line; File("example.txt").byLine(No.keepTerminator, "\r\n")){
                writeln("|"~line~"|");
                if (line == "   HelloWorld") { writeln("^This Line is here."); }
        }

}
```

Reply via email to