A
Adam Sandler
Hello,
I'm trying to input a txt file. Each line in the text file contains a
discrete code or value -- so I want to populate the an arraylist with
each line. I've noticed a problem. The code I have never reads the
last line of the file. Here's the code:
while (!sr.EndOfStream)
{
line = sr.ReadLine();
}
sr.Close();
If the txt file has 10 lines, after this code, there are only 9 items
in the arraylist. How can I get that last line in my arraylist?
Suggestions are greatly appreciated.
Thanks!
I'm trying to input a txt file. Each line in the text file contains a
discrete code or value -- so I want to populate the an arraylist with
each line. I've noticed a problem. The code I have never reads the
last line of the file. Here's the code:
while (!sr.EndOfStream)
{
line = sr.ReadLine();
}
sr.Close();
If the txt file has 10 lines, after this code, there are only 9 items
in the arraylist. How can I get that last line in my arraylist?
Suggestions are greatly appreciated.
Thanks!