question: public static String removeAllLineSeparators ( String text ) { Pattern crlf = Pattern . compile ( "(\r\n|\r|\n|\n\r)" ) ; Matcher m = crlf . matcher ( text ) ; if ( m . find ( ) ) { text = m . replaceAll ( " " ) ; } return text ; }
target:  Removes all possible line feed character combinations. This might be important for GUI purposes like tool tip texts which do not support carriage return combinations.