The OpenD Programming Language

smallerStringFirst

Compares strings by length and then lexicographically.

template smallerStringFirst(alias direction = "<")
bool
smallerStringFirst
(
T
)
(
T[] a
,
T[] b
)
if (
direction == "<" ||
direction == ">"
)

Members

Functions

smallerStringFirst
bool smallerStringFirst(T[] a, T[] b)

Examples

assert(smallerStringFirst("aa", "bb") == true);
assert(smallerStringFirst("aa", "aa") == false);
assert(smallerStringFirst("aaa", "aa") == false);

Meta