Using Eclipse under windows I'm trying to split a text in two parts, the one from the start until the first line break and the rest of it
String[] result = resumen.split("\\R", 2);
String firstpart = result[0];
String rest = result[1];
Works ok.
But on a Linux machine I'm getting the error:
Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 1
\R
So I read somewhere on SO that I can use:
String[] result = resumen.split("\\\\R", 2);
But this does not work as expect and it doesnt split the sentence.
How can I adapt the code so it can work on a linux machine too?
Thanks in advance.