A 32-bit signed integer indicating the lexical relationship between the two comparands.
zero The two strings are equal.
less than zero The specified section of string1 is less than the specified section of string2.
greater than zero The specified section of string1 is greater than the specified section of string2.
If a security decision depends on a string comparison or a case change, you should use the CultureInfo.InvariantCulture property to ensure that the behavior is consistent regardless of the culture settings of the operating system.
When possible, you should call string comparison methods that have a parameter of type System.Globalization.CompareOptions to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify CompareOptions.Ordinal or CompareOptions.OrdinalIgnoreCase for security comparisons.