![]() |
![]() ![]() ![]() |
When you comapre characters (mostly declared as char data type), you should not
use the operator such as '>', '<' and '='.
Each programming language provides functions for
character/string comparison, so using them is recommended.
Some of the main functions are listed below.
strcoll wcscoll
String.equals String.comapreTo String.compareToIgnoreCase Character.equals Character.comapreTo Character.compareToIgnoreCase
String.Compare String.CompareTo String.CompareOrdinal
CString.Compare
*Visual Basic 6.0 compares strings with operators ("<", ">", "=", and "Like"). Comparing mode can be switched to binary or text by Option Compare statement. Option Compare Binary means "AAA" < "aaa". Option Compare Text means "AAA" = "aaa".
*JavaScript compares strings with operators ("<", ">", "="). You should note that non-ASCII character comparison (e.g. Japanese) with operators "<" or ">" sometimes returns different results in each browser. if possible, you'd better avoid general character comparison in JavaScript. charCodeAt, the function to return the code of characters in strings, sometimes returns different results based on character encodings used by browsers too, and its usage is not recommended for non-ASCII characters.
flash.globalization. Collator.compare Collator.equals About flash.globalization, Refer to here.
Go to Internationalization Programming Top