StringSegmentGetHashCode(StringComparison) Method

Returns the hash code for this StringSegment using the specified comparison.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public int GetHashCode(
	StringComparison comparison
)

Parameters

comparison  StringComparison
A StringComparison value that specifies the way of generating the hash code.

Return Value

Int32
A 32-bit signed integer hash code.

Remarks

If comparison is Ordinal or OrdinalIgnoreCase, then no new string allocation occurs on any platforms.

If comparison is culture dependent (including the invariant culture), then depending on the targeted platform a new string allocation may occur. The .NET Core 3.0 and newer builds do not allocate a new string with any comparison values.

See Also