Reading a line from stdin
Jesse Phillips
jessekphillips+D at gmail.com
Wed Mar 16 09:02:36 PDT 2011
spir Wrote:
> On 03/16/2011 06:41 AM, Jesse Phillips wrote:
> > Ali Ãehreli Wrote:
> >
> >> Right? Is there a better way that I am missing?
> >>
> >> Thank you,
> >> Ali
> >
> > No better way, the stated reason IIRC is that it is easier to remove the new line then to append it back on.
>
> May be stated, but it is very wrong! I guess:
Sorry what I believe it refers to is that it is easier for the computer. There is no need to allocate or reallocate any memory.
> And it's not what programmers want in most cases, anyway. Actually, when does
> one need it?
I do not know of an actual use case for needing the new line. In fact you could argue that splitlines should keep the end line character, but no one would see that.
More information about the Digitalmars-d-learn
mailing list