Record separator is being lost after string cast

Kadir Erdem Demir via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 4 01:28:27 PST 2015


> don't beleive what you see! ;-)

I am sorry make a busy community more busy with false alarms.
When I write to file I saw Record Separator really exists.

I hope my second question is a valid one.
How can I write the code below better? How can I reduce the 
number of foreach? statements.

     File file = File(mylog.gz, "r");
     auto uc = new UnCompress();
     foreach (ubyte[] curChunk; file.byChunk(4096*1024))
     {
         auto uncompressed = cast(string)uc.uncompress(curChunk);
         writeln(uncompressed);
         auto stringRange = uncompressed.splitLines();
         foreach (string line; stringRange)
         {

Thanks a lot for replies
Kadir Erdem


More information about the Digitalmars-d-learn mailing list