Function difft::lines::split_on_newlines
source · pub(crate) fn split_on_newlines(s: &str) -> impl Iterator<Item = &str>
Expand description
Split s
on \n or \r\n. Always returns a non-empty vec. Each line
in the vec does not include the trailing newline.
This differs from str::lines
, which considers ""
to be zero
lines and "foo\n"
to be one line.