Module str_indices::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

  • Counts the line breaks in a string slice.
  • Converts from byte-index to line-index in a string slice.
  • Converts from line-index to byte-index in a string slice.