private static int countNewLines ( char [ ] ch , int start , int length ) { int newLineCount = 0 ; // quite reliable, since only Commodore 8-bit machines, TRS-80, Apple II family, Mac OS up to version 9 and OS-9 // use only '\r' for ( int i = start ; i < length ; i ++ ) { newLineCount = newLineCount + ( ( ch [ i ] == ' ' ) ? 1 : 0 ) ; } return newLineCount ; }
Count the number of new lines