String localeCompare
Hi every,
Has anyone experience with StringA.localeCompare(StringB) method?
Does it need any library or preferences to work?
Jarek
Hi every,
Has anyone experience with StringA.localeCompare(StringB) method?
Does it need any library or preferences to work?
Jarek
Jarek -- You're right. I thought it worked ok because:
'b'.localeCompare('b') // returns 0
'b'.localeCompare('a') // returns 1
'b'.localeCompare('c') // returns -1
Setting the locale to Polish doesn't help (as it shouldn't, but you never know), nor various variants of the locale string (pl, PL, pl_PL): "ą".localeCompare("z", "pl") keeps returning 1 instead of -1. The examples shown in that link don't work either. Don't know how to make it work. Sorry.
Peter
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.