I am new to C #, so bear with me. I have a text file that I upload with a single column of numbers. I can upload the file and run them through the code below, but how can I put them on one line?
file data (each number on the separte line, carriage return); 12345 54321 22222
final result; '12345', '54321', '22222'
private void button1_Click(object sender, EventArgs e)
{
int counter = 0;
string line;
ArrayList combine = new ArrayList();
System.IO.StreamReader file =
new System.IO.StreamReader("c:\\test.txt");
while ((line = file.ReadLine()) != null)
{
Console.WriteLine(line);
counter++;
MessageBox.Show(line);
}
file.Close();
source
share