Skip to main content

paragraph_bounds

Function paragraph_bounds 

Source
pub fn paragraph_bounds(text: &str) -> Vec<(usize, usize)>
Expand description

The \n-delimited paragraphs of text, as byte ranges INCLUDING the terminator.

An empty string has no paragraphs. A trailing newline makes an empty final paragraph, the way an editor shows a blank last line, so "a\n" is two paragraphs, not one.

Day API ↩ Guides· daybrite.dev