I have a test file that contains
1,2,3
2,3,4
5,6,7
I want to insert this into the first line: A,B,C
So that I get:
@Jake: StringBuilder is better and easiest
public static void WriteToFile(string path, string text)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine("a,b,c");
stringBuilder.Append(File.ReadAllText(path)).AppendLine();
File.WriteAllText(path, stringBuilder.ToString());
}
Edit: But StringBuilder has a buffer limit: Maximum Capacity 2147483647