Skip to main content

char_count

Function char_count 

Source
pub fn char_count(value: &str) -> usize
Expand description

Returns the number of Unicode scalar values in a string.

This is intentionally not a grapheme-cluster count. Product validation rules that need user-perceived characters should use a dedicated Unicode segmentation policy at the product boundary.