Read Me - Common Public License V1.0 - Copyright Notice(©)

compareTo


>>-compareTo(string-+-----------------------+-)----------------------><
                    +-,--+---+--+---------+-+
                         +-n-+  +-,length-+

Performs a sort comparison of the target string to the [string] argument. If the two strings are equal, 0 is returned. If the target string is larger, 1 is returned. -1 if the [string] argument is the larger string. The comparison is performed starting at character [n] for [length] characters in both strings. [n] must be a positive whole number. If [n] is omitted, the comparison starts at the first character. [length] must be a non-negative whole number. If omitted, the comparison will take place to the end of the target string.

String class - compareTo method



"abc"~compareTo("abc")         ->    0
"b"~compareTo("a")             ->    1
"a"~compareTo("b")             ->   -1
"abc"~compareTo("aBc")         ->    1
"aBc"~compareTo("abc")         ->   -1
"000abc000"~compareTo(111abc111", 4, 3)  -> 0

Read Me - Common Public License V1.0 - Copyright Notice(©)