Skip to main content

natural_cmp

Function natural_cmp 

Source
pub fn natural_cmp(a: &str, b: &str) -> Ordering
Expand description

Compares names as people read them: a run of digits is a number (IMG_9 before IMG_10), and case does not matter. Names that read the same (a and A, 01 and 1) take the order of their characters, so that this is a total order. It compares characters, not a language’s collation: é comes after z.