I'm trying to split String
by lines. The problem is I'm unable to split last lines if they're empty.
For example if input String
is like this:
asd\n\na\n\n\n
I use split like this:
Split(String input) {
List<String> list = new ArrayList<String>(Arrays.asList(input.split("\n")));
GWT.log("How many lines: "+list.size());
}
I get How many lines: 3
on the logs, although it has to be 5. Last two blank lines is not being split. What am I missing?