I need to retrieve the last character of a file. It may be a line break, or one of many special characters. Can I retrieve this character without parsing through the entire file? Or is there a way that I can read an entire file into a string without worry about line breaks?
I will essentially need to split the contents of the file, based on the last character of the file. So if it is a line break, I will split the string by '\n'.
You can Seek() to the end of file - 1, then just Read() one byte.
I do not have the exact functionnames and constants for the Seek at the moment, check the Stream Documentation for those.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With