Skip to main content

split_into_lines

Function split_into_lines 

Source
pub fn split_into_lines<'a>(
    segments: impl IntoIterator<Item = Segment<'a>>,
) -> SegmentLines<'a>
Expand description

Split segments by newlines into lines.

This function processes a sequence of segments and splits them into separate lines whenever a newline control code is encountered.

A newline creates a new line, so “a\nb” becomes [“a”, “b”] (2 lines), and “\n” becomes [“”, “”] (2 empty lines).