question: public static String removeEmptyLines ( String text ) { text = text . replaceAll ( "^[ " + ChineseLanguageConstants . SPACE [ 0 ] + "\t \r\n]*\n" , "" ) ; text = text . replaceAll ( "[\r\n][ " + ChineseLanguageConstants . SPACE [ 0 ] + "\t \r\n]*\n" , "\n" ) ; return text ; }
target:  Remove empty lines. An empty line means a line ends in \n or \r\n and contains only white space characters, or no characters at all.