Detecting end of line and end of file while using the .Read() method
Detecting end of line and end of file while using the .Read() method
Author
Message
Nathan Sokalsk #1 / 1
Detecting end of line and end of file while using the .Read() method
I am using the Read() and ReadLine() methods to get the text from a text file. I just recently learned how to do this, but I have used Javascript to search long strings character by character in the past. When I searched strings in the past, I used an if statement to test if each character was equal to "\n", and eventually concluded that there was a "\r\n" between the end and beginning of each line. However, this does not seem to be true for reading from a text file (I tried testing for "\n" and testing for "\r", but niether one seemed to be there). In a class I once took, there were specific codes (I believe the end of line one was EOL) for end of line and end of file. How do you do it in Javascript? -- Nathan Sokalski