Skip to main content

string_char_count

Function string_char_count 

Source
pub fn string_char_count(text: &str) -> usize
Expand description

Character count with a byte-length fast path for ASCII text.

Harn exposes string lengths as Unicode scalar counts. ASCII is one byte per scalar, so cached string count / len paths can avoid a full iterator scan without changing behavior for non-ASCII text.