Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • \n is the newline character in Java. String manipulation is somewhat complex, but you can get the length of a String, subsequences of a String and build new Strings from them. I suggest you check the API for your version of Java -- Java 7 API. Commented Dec 19, 2014 at 2:06
  • "tell java to go to next line" means ignore the rest of the line and read the next line from the Text-File or you want to make line break in the read string? Commented Dec 19, 2014 at 2:13
  • 1
    @Rami.Q i think he wants to add \n to the sentence so that it displays as 4 lines. I'm thinking the problem can actually be solved using word wrap in the java console ;) Commented Dec 19, 2014 at 2:15
  • It sounds like your problem is with the presentation of the information, not the reading from the file. Commented Dec 19, 2014 at 2:18
  • if the line has for example 250 alphabets , i want java to show 100 and than go to the next line and show another 100 and than show 50. Not ignore the rest. yes in GUI. thank you Commented Dec 19, 2014 at 2:18