Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java remove empty lines from string

String text = "line 1

line 3


line 5";
String adjusted = text.replaceAll("(?m)^[ 	]*
?
", "");
// ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #remove #empty #lines #string
ADD COMMENT
Topic
Name
7+3 =