Good name for f.byLine.map!(x => x.idup)?

Etienne etcimon at gmail.com
Mon Mar 17 06:51:09 PDT 2014


On 2014-03-16 10:31 PM, Etienne Cimon wrote:
>
> auto ln = f.split("\n", 15); // returns a gc allocated array of 15 lines

Moving it to a template and rethinking the naming

auto lines = f.splitLn!15; // returns 15 lines
auto lines = f.split!";" // splits the file using ; sep
auto lines = f.splitLn

I consider this to be an essential part of file reading, not necessarily 
line separation but moving the file pointer forward a number of elements 
with a choice of characters.


More information about the Digitalmars-d mailing list