October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Different cultures follow different conventions when comparing and sorting string values. If you need to compare or sort string values in your code, you should use the String.Compare() method and optionally supply the method with an instance of the CultureInfo object.
The String.Compare() method returns one of the following values:
• Negative Integer— The first string is less than the second string.
• Zero— The first string is equal to the second string.
• Positive Integer— The first string is greater than the second string.
For example, the following conditional compares two strings, using the current culture set for the page:
if (String.Compare("Hello", "Hello") == 0) lblResult.Text = "The strings are the ...