public static StringSegmentComparer Create(
CultureInfo culture,
CompareOptions options
)
Public Shared Function Create (
culture As CultureInfo,
options As CompareOptions
) As StringSegmentComparer
public:
static StringSegmentComparer^ Create(
CultureInfo^ culture,
CompareOptions options
)
static member Create :
culture : CultureInfo *
options : CompareOptions -> StringSegmentComparer
If culture is either the InvariantCulture or the CurrentCulture, then depending on the targeted platform, the GetHashCode(StringSegment) and GetHashCode(ReadOnlySpanChar) methods might allocate a new string. In .NET Core 3.0 and above none of the members of the returned StringSegmentComparer will allocate new strings.
If culture is any CultureInfo other than the InvariantCulture and CurrentCulture, then depending on the targeted platform, the GetHashCode(StringSegment), GetHashCode(ReadOnlySpanChar), Equals(ReadOnlySpanChar, ReadOnlySpanChar) and Compare(ReadOnlySpanChar, ReadOnlySpanChar) methods might allocate a new string. In .NET Core 3.0 and above none of the members with StringSegment parameters will allocate new strings. And methods with ReadOnlySpanT parameters (Equals(ReadOnlySpanChar, ReadOnlySpanChar) and Compare(ReadOnlySpanChar, ReadOnlySpanChar)) can avoid allocating strings when targeting .NET 5.0 or higher.