Link Search Menu Expand Document

UString.LocaleCompare Method

Explanation Compare strings based on locale.
The current implementation is byte-by-byte comparison regardless of locale.
Call format var ret = str.LocaleCompare( comp )
Return value Returns 1 if greater than comp
Returns -1 if less than comp
Returns 0 if equal to comp
Arguments UString comp String to compare
Exception Func-4 Invalid argument
Example of use
var str = new UString("abcdefg");
print(str.LocaleCompare("abcdefg"), "\n"); /* return 0 */
print(str.LocaleCompare("ABC"), "\n");     /* return 1 */
print(str.LocaleCompare("bcd"), "\n");     /* return -1 */
    
Related item EqualsIgnoreCase method