Carsten Kraft <Ca***********@RR-Software.de> wrote:
I think this is easy for you: I want to save the data line by line into an
string array.
eg.
Text file: Array
Line 1 [0] Line1
Line 2 [1] Line 2
Line 3 [2] Line 3
Line n [3] Line n
How can I do this?
Create an ArrayList.
Open the file with a StreamReader.
Repeatedly call ReadLine, saving the result to the ArrayList until the
result is null.
If you really need an ArrayList rather than an array, use
string[] array = (string[]) arrayList.ToArray(typeof(string));
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too