Show / Hide Table of Contents

Class RuneComparer

Represents Rune comparison operation that uses specific case and culture-based or ordinal comparison rules.

Inheritance
object
RuneComparer
Implements
IEqualityComparer<Rune>
IComparer<Rune>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Text
Assembly: DotNext.dll
Syntax
public abstract class RuneComparer : IEqualityComparer<Rune>, IComparer<Rune>

Constructors

View Source

RuneComparer()

Initializes a new instance of comparer.

Declaration
protected RuneComparer()

Methods

View Source

Compare(Rune, Rune)

Compares two runes and returns an indication of their relative sort order.

Declaration
public abstract int Compare(Rune x, Rune y)
Parameters
Type Name Description
Rune x

The first rune to compare.

Rune y

The second rune to compare.

Returns
Type Description
int

A number indicating relative sort order of the runes.

View Source

Compare(Rune, Rune, StringComparison)

Compares two runes and returns an indication of their relative sort order.

Declaration
public static int Compare(Rune x, Rune y, StringComparison comparisonType)
Parameters
Type Name Description
Rune x

The first rune to compare.

Rune y

The second rune to compare.

StringComparison comparisonType

The comparison type.

Returns
Type Description
int

A number indicating relative sort order of the runes.

View Source

Create(CultureInfo, CompareOptions)

Creates rune comparer for the specified culture.

Declaration
public static RuneComparer Create(CultureInfo culture, CompareOptions options)
Parameters
Type Name Description
CultureInfo culture

A culture whose linguistic rules are used to perform a string comparison.

CompareOptions options

Comparison options.

Returns
Type Description
RuneComparer

Culture-specific comparer.

Exceptions
Type Condition
ArgumentNullException

culture is null.

View Source

Equals(Rune, Rune)

Determines whether the two runes are equal.

Declaration
public abstract bool Equals(Rune x, Rune y)
Parameters
Type Name Description
Rune x

The first rune to compare.

Rune y

The second rune to compare.

Returns
Type Description
bool

true if both runes are equal; otherwise, false.

View Source

Equals(Rune, Rune, StringComparison)

Determines whether the two runes are equal.

Declaration
public static bool Equals(Rune x, Rune y, StringComparison comparisonType)
Parameters
Type Name Description
Rune x

The first rune to compare.

Rune y

The second rune to compare.

StringComparison comparisonType

The comparison type.

Returns
Type Description
bool

true if both runes are equal; otherwise, false.

View Source

FromComparison(StringComparison)

Converts StringComparison to RuneComparer.

Declaration
public static RuneComparer FromComparison(StringComparison comparison)
Parameters
Type Name Description
StringComparison comparison

A rune comparer instance to convert.

Returns
Type Description
RuneComparer

A comparer representing the specified comparison type.

Exceptions
Type Condition
ArgumentOutOfRangeException

comparison is invalid.

View Source

GetHashCode(Rune)

Gets the hash code for the specified rune.

Declaration
public abstract int GetHashCode(Rune rune)
Parameters
Type Name Description
Rune rune

A rune.

Returns
Type Description
int

A hash code of the rune.

View Source

GetHashCode(Rune, StringComparison)

Gets the hash code for the specified rune.

Declaration
public static int GetHashCode(Rune rune, StringComparison comparisonType)
Parameters
Type Name Description
Rune rune

A rune.

StringComparison comparisonType

The comparison type.

Returns
Type Description
int

A hash code of the rune.

Implements

IEqualityComparer<T>
IComparer<T>

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾