Why does readln include the line terminator?

Kagamin spam at here.lot
Wed Apr 15 02:04:23 PDT 2009


Stewart Gordon Wrote:

> Take these four cases:
> (a) you want to process only files with a specific line ending style
> (b) you want to know what line endings are used
> (c) you don't care about what line endings are used, but still want to 
> know whether or not the file ends with one
> (d) you just want to read the file line by line, without caring about 
> the line endings or the presence or absence of one at the end
> 
> At the moment, readln is good only for (a).  readLine is good only for 
> (d).  If you want (b) or (c), you'll have to come up with an alternative 
> means.

I think, only (d) is important, all others are *strange* things. I usually use ReadLine in conjunction with WriteLine.



More information about the Digitalmars-d mailing list