Product Site

5.1.7.35. caselessCompare

Returns 0 if the argument string is identical to the receiving string using a caseless comparison. Otherwise, returns the position of the first character that does not match. The shorter string is padded on the right with pad if necessary. The default pad character is a blank.
Example 5.75. String class — caselessCompare method
Say "abc"~caselessCompare("ABC")         -->    0
Say "abc"~caselessCompare("Ak")          -->    2
Say "ab "~caselessCompare("AB")          -->    0
Say "AB "~caselessCompare("ab"," ")      -->    0
Say "ab "~caselessCompare("ab","x")      -->    3
Say "abXX "~caselessCompare("ab","x")    -->    5