Delete the last line of a file?

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

What would be the most efficient (in terms of performance)
possible way of deleting the last line from a text file in
vb.net. Also can I get a count of the number of lines in
the file from anything?
 
You would have to read in the file to count all of it's lines.

Unless, of course, each line was equal in size. Then you could just take
the filesize and divide by the line length to get the number of lines.
 
Back
Top