How To Split Java String By Newlines

How To Split Java String By Newlines

Note: This article will be emailed to your friend.

Splitting a String by newline is a common requirement. When processing textual data from files or from web we need to split the data by newline boundaries. The solution aren’t hard either. Let’s see a simple one liner solution using String.split().

String[] poList = pos.split("\r\n|\r|\n");
What did I do?
I am splitting the String based on a regular [...]

Read the rest of this article (156 words)

Please fill in the following fields

* - Required

Your Name: *

Your E-Mail: *

Your Remarks:

Friend's Name: *

Friend's E-Mail: *

Protected by Comment Guard Pro