MCPcopy Create free account
hub / github.com/a8m/tree / NaturalLess

Function NaturalLess

sort.go:67–116  ·  view source on GitHub ↗

NaturalLess compares two strings using natural ordering. This means that e.g. "abc2" < "abc12". Non-digit sequences and numbers are compared separately. The former are compared bytewise, while the latter are compared numerically (except that the number of leading zeros is used as a tie-breaker, so

(str1, str2 string)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

VerSortFunction · 0.85

Calls 1

isdigitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…