StringSegmentComparer Class
Represents a string comparison operation that uses specific case and culture-based or ordinal comparison rules
allowing comparing strings by
string,
StringSegment and
ReadOnlySpan<char> instances.
See the static properties for more details.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
[SerializableAttribute]
public abstract class StringSegmentComparer : IEqualityComparer<StringSegment>,
IComparer<StringSegment>, IEqualityComparer<string>, IComparer<string>,
IAlternateEqualityComparer<StringSegment, string>, IAlternateEqualityComparer<ReadOnlySpan<char>, string>,
IEqualityComparer, IComparer
<SerializableAttribute>
Public MustInherit Class StringSegmentComparer
Implements IEqualityComparer(Of StringSegment), IComparer(Of StringSegment),
IEqualityComparer(Of String), IComparer(Of String), IAlternateEqualityComparer(Of StringSegment, String),
IAlternateEqualityComparer(Of ReadOnlySpan(Of Char), String), IEqualityComparer,
IComparer
[SerializableAttribute]
public ref class StringSegmentComparer abstract : IEqualityComparer<StringSegment>,
IComparer<StringSegment>, IEqualityComparer<String^>, IComparer<String^>,
IAlternateEqualityComparer<StringSegment, String^>, IAlternateEqualityComparer<ReadOnlySpan<wchar_t>, String^>,
IEqualityComparer, IComparer
[<AbstractClassAttribute>]
[<SerializableAttribute>]
type StringSegmentComparer =
class
interface IEqualityComparer<StringSegment>
interface IComparer<StringSegment>
interface IEqualityComparer<string>
interface IComparer<string>
interface IAlternateEqualityComparer<StringSegment, string>
interface IAlternateEqualityComparer<ReadOnlySpan<char>, string>
interface IEqualityComparer
interface IComparer
end
- Inheritance
- Object StringSegmentComparer
- Implements
- IAlternateEqualityComparerStringSegment, String, IAlternateEqualityComparerReadOnlySpanChar, String, IComparerStringSegment, IComparerString, IEqualityComparerStringSegment, IEqualityComparerString, IComparer, IEqualityComparer
CompareInfo |
Gets a CompareInfo that is associated with this StringSegmentComparer
or if this StringSegmentComparer is not a culture-aware one.
|
CompareOptions |
Gets the CompareOptions that is associated with this StringSegmentComparer.
|
CurrentCulture |
Gets a StringSegmentComparer object that performs a case-sensitive string comparison using the word comparison rules of the current culture.
Depending on the targeted platform, the GetHashCode(StringSegment) method might allocate a new string.
In .NET Core 3.0 and above none of the members of the returned StringSegmentComparer will allocate new strings.
|
CurrentCultureIgnoreCase |
Gets a StringSegmentComparer object that performs case-insensitive string comparisons using the word comparison rules of the current culture.
Depending on the targeted platform, the GetHashCode(StringSegment) method might allocate a new string.
In .NET Core 3.0 and above none of the members of the returned StringSegmentComparer will allocate new strings.
|
InvariantCulture |
Gets a StringSegmentComparer object that performs a case-sensitive string comparison using the word comparison rules of the invariant culture.
Depending on the targeted platform, the GetHashCode(StringSegment) method might allocate a new string.
In .NET Core 3.0 and above none of the members of the returned StringSegmentComparer will allocate new strings.
|
InvariantCultureIgnoreCase |
Gets a StringSegmentComparer object that performs a case-insensitive string comparison using the word comparison rules of the invariant culture.
Depending on the targeted platform, the GetHashCode(StringSegment) method might allocate a new string.
In .NET Core 3.0 and above none of the members of the returned StringSegmentComparer will allocate new strings.
|
Ordinal |
Gets a StringSegmentComparer object that performs a case-sensitive ordinal string comparison.
The methods of the returned StringSegmentComparer instance can be called with string, StringSegment
and ReadOnlySpan<char> parameter values, which will not allocate new strings on any platform.
|
OrdinalIgnoreCase |
Gets a StringSegmentComparer object that performs a case-insensitive ordinal string comparison.
The methods of the returned StringSegmentComparer instance can be called with string, StringSegment
and ReadOnlySpan<char> parameter values, which will not allocate new strings on any platform.
|
OrdinalIgnoreCaseNonRandomized |
Gets a StringSegmentComparer object that performs a case-insensitive ordinal string comparison. The returned comparer is functionally equivalent
with OrdinalIgnoreCase but it ensures that the hash code of a specific string is stable only within the same process and AppDomain.
|
OrdinalIgnoreCaseRandomized |
Gets a StringSegmentComparer object that performs a case-insensitive ordinal string comparison. The returned comparer is functionally equivalent
with OrdinalIgnoreCase but it ensures that the hash code of a specific string is stable only within the same process and AppDomain.
|
OrdinalNonRandomized |
Gets a StringSegmentComparer object that performs a case-sensitive ordinal string comparison. The returned comparer is functionally equivalent
with Ordinal but it ensures that the hash code of a specific string is always the same, regardless of the targeted platform or the length of the string.
|
OrdinalRandomized |
Gets a StringSegmentComparer object that performs a case-sensitive ordinal string comparison. The returned comparer is functionally equivalent
with Ordinal but it ensures that the hash code of a specific string is stable only within the same process and AppDomain.
|
Compare(Object, Object) |
When overridden in a derived class, compares two objects and returns an indication of their relative sort order.
|
Compare(ReadOnlySpanChar, ReadOnlySpanChar) |
When overridden in a derived class, compares two ReadOnlySpan<char> instances and returns an indication of their relative sort order.
|
Compare(String, String) |
When overridden in a derived class, compares two string instances and returns an indication of their relative sort order.
|
Compare(StringSegment, StringSegment) |
When overridden in a derived class, compares two StringSegment instances and returns an indication of their relative sort order.
|
Create(CultureInfo, Boolean) |
Creates a StringSegmentComparer object that compares strings according to the rules of a specified culture.
Please note that the returned StringSegmentComparer may allocate new strings in some cases when targeting older frameworks.
See the Remarks section for details.
|
Create(CultureInfo, CompareOptions) |
Creates a StringSegmentComparer object that compares strings according to the rules of a specified culture.
Please note that the returned StringSegmentComparer may allocate new strings in some cases when targeting older frameworks.
See the Remarks section for details.
|
Equals(Object, Object) |
When overridden in a derived class, indicates whether two objects are equal.
|
Equals(ReadOnlySpanChar, ReadOnlySpanChar) |
When overridden in a derived class, indicates whether two ReadOnlySpan<char> instances are equal.
|
Equals(String, String) |
When overridden in a derived class, indicates whether two string instances are equal.
|
Equals(StringSegment, StringSegment) |
When overridden in a derived class, indicates whether two StringSegment instances are equal.
|
FromComparison |
Gets a StringSegmentComparer instance based on the specified comparison.
Please note that the returned StringSegmentComparer may allocate new strings in some cases. See the description of the properties for more details.
|
GetHashCode(Object) |
When overridden in a derived class, gets the hash code for the specified object.
|
GetHashCode(ReadOnlySpanChar) |
When overridden in a derived class, gets the hash code for the specified ReadOnlySpan<char>.
|
GetHashCode(String) |
When overridden in a derived class, gets the hash code for the specified string.
|
GetHashCode(StringSegment) |
When overridden in a derived class, gets the hash code for the specified StringSegment.
|