write to file array by lines
Suliman via Digitalmars-d
digitalmars-d at puremagic.com
Tue Mar 15 03:58:16 PDT 2016
I have got:
string [] total_content;
I am appending to it data on every iteration.
total_content ~= somedata
File file = File(`D:\code\2vlad\result.txt`, "a+");
file.write(total_content);
I need to write it's to file by lines. Like:
somedataline1
somedataline2
somedataline3
I tried to do like:
total_content ~= somedata ~ "\n"
but in result I am getting all data in one line:
somedataline1 "\n" somedataline2 "\n" somedataline3 "\n"
what I am doing wrong? I know about split, but how it can be
called on writing time?
More information about the Digitalmars-d
mailing list