The OpenD Programming Language

smallerStringFirstCmp

Compares strings by length and then lexicographically.

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