Java examples for java.lang:String New Line
filter Break Line
import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static String filterBreakLine(String lines) { Pattern p = Pattern.compile("\\r\\n|\\r"); Matcher m = p.matcher(lines); return (m.replaceAll("")).replaceAll("\\s+", " "); }// w w w. jav a 2 s . co m }