Skip to main content

byte_offset_to_line

Function byte_offset_to_line 

Source
fn byte_offset_to_line(source: &str, offset: usize) -> usize
Expand description

Convert a byte offset in source text to a 1-based line number.