smallerStringFirstCmp

Compares strings by length and then lexicographically.

sizediff_t
smallerStringFirstCmp
(
T
)
(
T[] a
,
T[] b
)

Examples

assert(smallerStringFirstCmp("aa", "bb") < 0);
assert(smallerStringFirstCmp("aa", "aa") == 0);
assert(smallerStringFirstCmp("aaa", "aa") > 0);

static assert(smallerStringFirstCmp("aa", "bb") < 0);
static assert(smallerStringFirstCmp("aa", "aa") == 0);
static assert(smallerStringFirstCmp("aaa", "aa") > 0);

Meta