Being a beginner to JAVA, I am trying to find out a solution for splitting paragraphs in a file, into lines of statements.
Eg:- Paragraph in the given text file "sample" is
"Welcome to programming in JAVA. Java was developed by James Gosling. It is an object oriented language. "
The desired output is
Welcome to programming in JAVA
Java was developed by James Gosling
Java is an object oriented language
Can anyone help me out to find the way of achieving this.
Re: splitting paragraph
Oh, what you might want to do is parse the text file and dump it's contents into a String variable. Then use something like the replace function in java.lang.String. Check out: String (Java Platform SE 6). The text you might want to replace would be the '. ' (a period and a whitespace) with a '\n' (newline character). Then you can use System.out.println(); to print out the contents of the String and see if it look like your desired output.
Hope this helps.