Skip to main content

count_nl

Function count_nl 

Source
pub(crate) fn count_nl(s: &str) -> usize
Expand description

Count the number of newlines that appear in s.

This is potentially one less than the number of lines in s, if the final line is not terminated, but that’s okay for our uses here.