numeric_stringversion
A comparison function for strings that sorts numeric fragments of strings according to their numeric value, so that e.g. "abc2" < "abc10".
A comparison function (and assorted sets / maps / etc.) for strings that sorts numeric fragments of strings according to their numeric value, so that e.g. "abc2" < "abc10".
People often call this "natural sort", and link to this:
https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/
which links to a few other posts about the matter. Sometimes it's called "alphanum sort" or "human sort" or something. "Numeric string compare" is chosen as the name that gets closest to expressing what it actually does (to me, "natural sort" sounds like something that might include a different treatment of case, special handling of whitespace or punctuation, etc.)
Author | Jane Street Group, LLC |
---|---|
License | MIT |
Published | |
Homepage | https://github.com/janestreet/numeric_string |
Issue Tracker | https://github.com/janestreet/numeric_string/issues |
Maintainer | Jane Street developers |
Available | arch != "arm32" & arch != "x86_32" |
Dependencies | |
Source [http] | https://github.com/janestreet/numeric_string/archive/refs/tags/v0.17.0.tar.gz sha256=d3c552957dd6e2b0791d5db4a9a50ec28eed60c2009acd46f9ecfd6891c2fe0f |
Edit | https://github.com/ocaml/opam-repository/tree/master/packages/numeric_string/numeric_string.v0.17.0/opam |
Required by
- janestreet_csv>=v0.17.0