Read Complete File to Array of Lines

Era Scarecrow rtcvb32 at yahoo.com
Fri May 11 13:06:44 PDT 2012


On Friday, 11 May 2012 at 19:24:49 UTC, Graham Fawcett wrote:
> It sure would. I suspect that Jesse's approach...
>
>   readText("file.in").splitLines()
>
> ...would be the most efficient way if you need an actual array: 
> slurp the whole file at once, then create an array of 
> memory-sharing slices.

  Doesn't sound hard.. I could likely write a quick line splitting 
ranges fairly quickly, assuming \r and \n are the newlines, if 
there's new ones I'm unaware of then it may not work quite as 
well as you want :P

  Let's see....


More information about the Digitalmars-d-learn mailing list