Module Compare
Description
Module Status: Polishing.
Usage:
local Compare = require('__eradicators-library__/erlib/lua/Compare')()
Section
STRING_SHORTER(a, b) | True if a is shorter than b. |
STRING_ALPHABETIC(a, b) | True if a is before b in natural language order. |
Section
- STRING_SHORTER(a, b)
-
True if a is shorter than b.
Equal length strings are sorted alphabetically.
Parameters:
Returns:
Usage:
print(Array.sort({'ababa','aaaa','aab'},Compare.STRING_SHORTER):to_string()) > {"aab", "aaaa", "ababa"}
- STRING_ALPHABETIC(a, b)
-
True if a is before b in natural language order.
Parameters:
Returns:
Usage:
print(Array.sort({'aaaa','aab','ababa'},Compare.STRING_ALPHABETIC):to_string()) > {"aaaa", "aab", "ababa"}