class StringComparer
Represents a string comparison operation that uses specific case and culture-based or ordinal comparison rules.
public int Compare( object x, object y )
When overridden in a derived class, compares two objects and returns an indication of their relative sort order.
xAn object to compare to .yAn object to compare to .- Returns A signed integer that indicates the relative values of and , as shown in the following table. Value Meaning Less than zero precedes in the sort order. -or- is and is not . Zero is equal to . -or- and are both . Greater than zero follows in the sort order. -or- is and is not .
public int Compare( string x, string y )
When overridden in a derived class, compares two strings and returns an indication of their relative sort order.
xA string to compare to .yA string to compare to .- Returns A signed integer that indicates the relative values of and , as shown in the following table. Value Meaning Less than zero precedes in the sort order. -or- is and is not . Zero is equal to . -or- and are both . Greater than zero follows in the sort order. -or- is and is not .
public static StringComparer Create( CultureInfo culture, bool ignoreCase )
Creates a object that compares strings according to the rules of a specified culture.
cultureA culture whose linguistic rules are used to perform a string comparison.ignoreCaseto specify that comparison operations be case-insensitive; to specify that comparison operations be case-sensitive.- Returns A new object that performs string comparisons according to the comparison rules used by the parameter and the case rule specified by the parameter.
public static StringComparer Create( CultureInfo culture, CompareOptions options )
No summary.
public static StringComparer CurrentCulture { get; }
Gets a object that performs a case-sensitive string comparison using the word comparison rules of the current culture.
- Returns A new object.
public static StringComparer CurrentCultureIgnoreCase { get; }
Gets a object that performs case-insensitive string comparisons using the word comparison rules of the current culture.
- Returns A new object for string comparison.
public bool Equals( object x, object y )
When overridden in a derived class, indicates whether two objects are equal.
xAn object to compare to .yAn object to compare to .- Returns if and refer to the same object, or and are both the same type of object and those objects are equal, or both and are ; otherwise, .
public bool Equals( string x, string y )
When overridden in a derived class, indicates whether two strings are equal.
xA string to compare to .yA string to compare to .- Returns if and refer to the same object, or and are equal, or and are ; otherwise, .
public static StringComparer FromComparison( StringComparison comparisonType )
No summary.
public int GetHashCode( object obj )
When overridden in a derived class, gets the hash code for the specified object.
objAn object.- Returns A 32-bit signed hash code calculated from the value of the parameter.
public int GetHashCode( string obj )
When overridden in a derived class, gets the hash code for the specified string.
objA string.- Returns A 32-bit signed hash code calculated from the value of the parameter.
public static StringComparer InvariantCulture { get; }
Gets a object that performs a case-sensitive string comparison using the word comparison rules of the invariant culture.
- Returns A new object.
public static StringComparer InvariantCultureIgnoreCase { get; }
Gets a object that performs a case-insensitive string comparison using the word comparison rules of the invariant culture.
- Returns A new object.
public static StringComparer Ordinal { get; }
Gets a object that performs a case-sensitive ordinal string comparison.
- Returns A object.
public static StringComparer OrdinalIgnoreCase { get; }
Gets a object that performs a case-insensitive ordinal string comparison.
- Returns A object.
public string ToString( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public static bool IsWellKnownCultureAwareComparer( IEqualityComparer<string> comparer, ref CompareInfo compareInfo, ref CompareOptions compareOptions )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public static bool IsWellKnownOrdinalComparer( IEqualityComparer<string> comparer, ref bool ignoreCase )
😔 No documentation found.