Answers for "how to check if there is new line in java string"

0

java detect new line in string

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");
}
Posted by: Guest on February-13-2021

Code answers related to "how to check if there is new line in java string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language