G
G
gr34ka13372021-07-21 20:44:51
C++ / C#
gr34ka1337, 2021-07-21 20:44:51

How to save multiple rows?

How to save multiple rows?

I use this code, but only one line is saved when a large number of lines are output to the console:
File.WriteAllText("random.txt", passed variables to save );

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-07-22
@gr34ka1337

You need

var lines = new [] {"a", "b", "c"};
File.WriteAllLines("filename.txt", lines);

K
kokapuk, 2021-07-21
@kokapuk

Make an array from these lines and serialize the array into any file, BinaryFormatter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question