Skip to main content

remove_block_linewise

Function remove_block_linewise 

Source
pub fn remove_block_linewise(content: &str, sentinel: &Sentinel<'_>) -> String
Expand description

Line-based block removal (sys::profile’s semantics).

Drops only the lines from the start marker through the end marker (inclusive); never consumes a preceding blank line separator, unlike remove_block_bytewise.

Because this iterates via str::lines, CRLF input is normalized to LF unconditionally — even when the sentinel isn’t present at all, since lines() always strips a trailing '\r' from each line. The presence or absence of a trailing newline on the original content is preserved on the result.