Module lines_lf

Source
Expand description

Index by lines (line feed only).

This module recognizes the following as line breaks:

  • U+000A โ€” LF (Line Feed)
  • U+000D U+000A โ€” CRLF (Carriage Return + Line Feed) โ€” by coincidence due to ignoring CR.

Functionsยง

count_breaks
Counts the line breaks in a string slice.
from_byte_idx
Converts from byte-index to line-index in a string slice.
to_byte_idx
Converts from line-index to byte-index in a string slice.