I want to write a string to file, n number of times (n being the length of the string). With each insertion being on a new line.
For example, the string "antallabel" (with a length of 10), should be inserted into a file 10 times, with each insertion on its own line. Should I use an array, list or something else?
I'm really new to programming, so I hope this question makes sense.
Check if file exists, then generate 2 files:
if (File.Exists(fullPath)) {
File.Delete(fullPath);
File.WriteAllText(fullPath, totalv + ";" + laste + ";" + antallabels);
File.Create(filePath + @"\" + controlFile).Close();
}
else
{
File.WriteAllText(fullPath, totalv + ";" + laste);
File.Create(filePath + @"\" + controlFile).Close();