Why does readln include the line terminator?

Walter Bright newshound1 at digitalmars.com
Tue Apr 14 03:22:36 PDT 2009


Daniel Keep wrote:
> Because if it stripped it, there's no way to know what it was.  If you
> want to do per-line processing but don't want to clobber the line
> endings, readln has to return the line terminator.

That's right; there are currently at least 6 different line terminators:

CR
LF
CRLF
FF
PS
LS



More information about the Digitalmars-d mailing list