here is one example how to use the split() function:
String s1="Hi, my name is ABCDE. \n I am 25 years old.\n";
String[] result=s1.split("\n");
for(int i=0;i<result.length;i++)
System.out.println(result[i]);
The output is: Line 1:Hi, my name is ABCDE.
Line 2:I am 25 years old.