Skip to main content

byte_offset

Function byte_offset 

Source
pub fn byte_offset(text: &str, position: Position) -> Option<usize>
Expand description

Where a position falls in text, as a byte offset, or None where the document has no such place: a line past the last one, a column past the end of its line, or a column that would split a character written as two UTF-16 units.