Represents a character comparison operation that uses specific case and culture-based or ordinal comparison rules.
Namespace: DotNext Assembly: DotNext.dll Syntaxpublic abstract class CharComparer : IEqualityComparer<char>, IComparer<char>
Constructors | Edit this page View Source CharComparer()
Initializes a new instance of comparer.
Declaration Methods | Edit this page View Source Compare(char, char)Compares two characters and returns an indication of their relative sort order.
Declarationpublic abstract int Compare(char x, char y)
Parameters Type Name Description char x
The first character to compare.
char yThe second character to compare.
Returns Type Description intA number indicating relative sort order of the characters.
| Edit this page View Source Compare(char, char, StringComparison)Compares two characters and returns an indication of their relative sort order.
Declarationpublic static int Compare(char x, char y, StringComparison comparisonType)
Parameters Type Name Description char x
The first character to compare.
char yThe second character to compare.
StringComparison comparisonTypeThe comparison type.
Returns Type Description intA number indicating relative sort order of the characters.
| Edit this page View Source Create(CultureInfo, CompareOptions)Creates character comparer for the specified culture.
Declarationpublic static CharComparer Create(CultureInfo culture, CompareOptions options)
Parameters Type Name Description CultureInfo culture
A culture whose linguistic rules are used to perform a string comparison.
CompareOptions optionsComparison options.
Returns Exceptions | Edit this page View Source Equals(char, char)Determines whether the two characters are equal.
Declarationpublic abstract bool Equals(char x, char y)
Parameters Type Name Description char x
The first character to compare.
char yThe second character to compare.
Returns Type Description booltrue if both characters are equal; otherwise, false.
| Edit this page View Source Equals(char, char, StringComparison)Determines whether the two characters are equal.
Declarationpublic static bool Equals(char x, char y, StringComparison comparisonType)
Parameters Type Name Description char x
The first character to compare.
char yThe second character to compare.
StringComparison comparisonTypeThe comparison type.
Returns Type Description booltrue if both characters are equal; otherwise, false.
| Edit this page View Source FromComparison(StringComparison)Converts StringComparison to CharComparer.
Declarationpublic static CharComparer FromComparison(StringComparison comparison)
Parameters Type Name Description StringComparison comparison
A character comparer instance to convert.
Returns Type Description CharComparerA comparer representing the specified comparison type.
Exceptions | Edit this page View Source GetHashCode(char)Gets the hash code for the specified character.
Declarationpublic abstract int GetHashCode(char ch)
Parameters Type Name Description char ch
A character.
Returns Type Description intA hash code of the character.
| Edit this page View Source GetHashCode(char, StringComparison)Gets the hash code for the specified character.
Declarationpublic static int GetHashCode(char ch, StringComparison comparisonType)
Parameters Returns Type Description int
A hash code of the character.
Implements Extension Methods See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4