protected List < String > splitLinesAndNewLines ( String text ) { if ( text == null ) return Collections . emptyList ( ) ; int idx = initialSegmentSize ( text ) ; if ( idx == text . length ( ) ) { return Collections . singletonList ( text ) ; } return continueSplitting ( text , idx ) ; }
Return a list of segments where each segment is either the content of a line in the given text or a line - break according to the configured delimiter . Existing line - breaks in the text will be replaced by this s instances delimiter .