private static int getLongestLineLen ( final String message ) { String newLine = System . getProperty ( "line.separator" ) ; String [ ] lines = message . split ( newLine ) ; int maxLen = 0 ; for ( String line : lines ) { maxLen = Math . max ( maxLen , line . length ( ) ) ; } return maxLen ; }
For a given multiline message determines the character count of the longest line .