Java wykryje nową linię w ciągu

String word = "A string \n with a new Line inside"
String newline = System.getProperty("line.separator");
boolean hasNewline = word.contains(newline);
if(hasNewLine){
	System.out.println("Enter has been pressed");
}
Karamolegkos