A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter.
Less than zero
This instance precedes strB.
This instance has the same position in the sort order as strB.
Greater than zero
This instance follows strB.
strB is null.
This method performs a word (case-sensitive and culture-sensitive) comparison using the current culture. For more information about word, string, and ordinal sorts, see System.Globalization.CompareOptions.
The string.CompareTo(object) method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the erload:System.String.Equals method.
For more information about the behavior of this method, see the Remarks section of the string.Compare(string, string) method.
This method implements the IComparable`1 interface and performs slightly better than the string.CompareTo(object) method, because it does not have to determine whether the value argument is a mutable value type that must be boxed, and it does not have to cast its parameter from an object to a string.