Class
StringComparer
class StringComparer
Module: System
Assembly: System.Runtime.dll
Source file: StringComparer.rvn
Inheritance: Object → StringComparer
Implements: Comparer<String>, EqualityComparer<String>
Consistent string equality, hashing and ordering under a consistent Unicode text policy.
Properties
3 items
Static member:
Default: StringComparer
Canonical Unicode 17 text identity and NFD scalar ordering, preserving stored bytes.
Static member:
Ordinal: StringComparer
Returns a stateless ordinal policy. Instance identity is not guaranteed.
Static member:
OrdinalIgnoreCase: StringComparer
Uses Unicode 17 default simple folding for equality, hashing and ordering.
Methods
7 items
Compare(left: string, right: string) -> int
Compares canonical, exact or simply folded scalar sequences under the selected policy.
Implements Comparer<String>.Compare
Equals(left: string, right: string) -> bool
Tests string equality under the selected policy.
Implements EqualityComparer<String>.Equals
Equals(other: object?) -> bool
Tests reference identity by default; an ordinary class may override equality.
Inherited from Object.Equals
GetHashCode(value: string) -> int
Hashes canonical text for Default, exact UTF-8 for Ordinal, or simply folded UTF-8 for OrdinalIgnoreCase.
Implements EqualityComparer<String>.GetHashCode
GetHashCode() -> int
Returns a stable identity hash by default; an ordinary class may override it consistently with equality.
Inherited from Object.GetHashCode
GetType() -> TypeInfo
Returns metadata for the concrete runtime type of this instance.
Inherited from Object.GetType
ToString() -> string
Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override.
Inherited from Object.ToString