Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java detect new line in string

String word = "A string 
 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");
}
 
PREVIOUS NEXT
Tagged: #java #detect #line #string
ADD COMMENT
Topic
Name
9+7 =