mohan21_kumar
asked on
How to split the new line character("\n") in string in JAVA
Hi,
I have a string where there is a new line character ("\n") and i want to split the new line character .
Example of string :
afasdfasdf
sfasdfasdffgsdgsg
dfhdgg
ghjh
After splitint the above string with str.split("\n");
i'm not able to get the splited part of the string pls suggest me how to split a string according to new line character
Thanx
I have a string where there is a new line character ("\n") and i want to split the new line character .
Example of string :
afasdfasdf
sfasdfasdffgsdgsg
dfhdgg
ghjh
After splitint the above string with str.split("\n");
i'm not able to get the splited part of the string pls suggest me how to split a string according to new line character
Thanx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the above code works but i want to check it for the file and split the file into no of files according to tne paragraph
http://www.javacoffeebreak.com/java103/java103.html
Here you can have a view on file handling in java.
Here you can have a view on file handling in java.