public static String toReadableForm ( String str ) { String ret = str ; if ( str != null && str . length ( ) > 0 && str . indexOf ( "\n" ) != - 1 && str . indexOf ( "\r" ) == - 1 ) { str . replaceAll ( "\n" , "\r\n" ) ; } return ret ; }
Converts the given string with CR and LF character correctly formatted .