Skip to main content

alphanumeric_sort

Function alphanumeric_sort 

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

Sort strings alphanumerically (e.g., “R1”, “R2”, “R10” instead of “R1”, “R10”, “R2”).

This function extracts numeric suffixes from strings and sorts them numerically while keeping the prefix in alphabetical order.