Using import to read a DOS file and then mapping the records to a string array

bearophile bearophileHUGS at lycos.com
Thu Mar 27 11:33:14 PDT 2014


Gary Miller:

> Once you read a text file using
>
> auto MyDictionary = import ("dictionary.txt");
>
> how can you parse this into a string array stripping the CrLf 
> from the end of each line?


import std.string;

immutable myDictionary = import("dictionary.txt").splitLines;
//pragma(msg, myDictionary);

void main() {}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list