I have a .txt file with some sentences typed in in this format: Sentence 1 Sentence 2 Sentence 3
Sentence 4 Sentence 5
I can read and show the contents of the file but what the problem is I just want it to show sentences 1 through 3. What do i use for it to recognize the new line? Ive tried the Search but to no avail. -Clay
What are you doing currently to read the file and display it? If you are only using a FileReader, it only allows you to read a single character at a time. However, you can use a BufferedReader to wrap around it and then read a whole line at a time. If you don't know how to do this (or even if you do), I strongly suggest you the I/O trail from the Java Tutorial. This should get you up to speed on the various classes that are available for reading and writing files.