I have a file which looks like this:
1
2
3
4
5
6
7
I want to read it in and remove the newline characters. My attempt is this:
StreamReader reader = new StreamReader("t.txt");
string text = reader.ReadToEnd();
text.Replace(System.Environment.NewLine, " ");
Console.WriteLine(text);
But the output is still the same as above. I want the output to be:
1 2 3 4 5 6 7
What am I doing wrong?