compareTo >>-compareTo(string-+-----------------------+-)---------------------->< +-,--+---+--+---------+-+ +-n-+ +-,length-+ Performs a sort comparison of the target string to the
[string]
argument. If the
two strings are equal, 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 |