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:

    boolean

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:

    boolean

Usage:

    print(Array.sort({'aaaa','aab','ababa'},Compare.STRING_ALPHABETIC):to_string())
    > {"aaaa", "aab", "ababa"}
    
generated by LDoc 1.4.6 Last updated 2021-09-10 19:51:19