Table of Contents

Method EndsWith

Namespace
Zyl.ExSpans
Assembly
ExSpans.dll

EndsWith<T>(ExSpan<T>, ReadOnlyExSpan<T>)

Determines whether the specified sequence appears at the end of the span.

public static bool EndsWith<T>(this ExSpan<T> span, ReadOnlyExSpan<T> value) where T : IEquatable<T>?

Parameters

span ExSpan<T>
value ReadOnlyExSpan<T>

Returns

bool

Type Parameters

T

EndsWith<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>)

Determines whether the specified sequence appears at the end of the span.

public static bool EndsWith<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> value) where T : IEquatable<T>?

Parameters

span ReadOnlyExSpan<T>
value ReadOnlyExSpan<T>

Returns

bool

Type Parameters

T

EndsWith<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>, IEqualityComparer<T>?)

Determines whether the specified sequence appears at the end of the read-only span.

public static bool EndsWith<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> value, IEqualityComparer<T>? comparer = null)

Parameters

span ReadOnlyExSpan<T>

The source span.

value ReadOnlyExSpan<T>

The sequence to compare to the end of span.

comparer IEqualityComparer<T>

The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element.

Returns

bool

Type Parameters

T

EndsWith<T>(ReadOnlyExSpan<T>, T)

Determines whether the specified value appears at the end of the span.

public static bool EndsWith<T>(this ReadOnlyExSpan<T> span, T value) where T : IEquatable<T>?

Parameters

span ReadOnlyExSpan<T>

The span to search.

value T

The value to compare.

Returns

bool

true if value matches the end of span; otherwise, false.

Type Parameters

T

The type of the elements in the span.

EndsWith<T>(ReadOnlyExSpan<T>, T, IEqualityComparer<T>?)

Determines whether the specified value appears at the end of the span.

public static bool EndsWith<T>(this ReadOnlyExSpan<T> span, T value, IEqualityComparer<T>? comparer = null)

Parameters

span ReadOnlyExSpan<T>

The span to search.

value T

The value to compare.

comparer IEqualityComparer<T>

The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element.

Returns

bool

true if value matches the end of span; otherwise, false.

Type Parameters

T

The type of the elements in the span.

EndsWith(ReadOnlyExSpan<char>, ReadOnlyExSpan<char>, StringComparison)

Determines whether the end of the span matches the specified value when compared using the specified comparisonType option.

public static bool EndsWith(this ReadOnlyExSpan<char> span, ReadOnlyExSpan<char> value, StringComparison comparisonType)

Parameters

span ReadOnlyExSpan<char>

The source span.

value ReadOnlyExSpan<char>

The sequence to compare to the end of the source span.

comparisonType StringComparison

One of the enumeration values that determines how the span and value are compared.

Returns

bool

Exceptions

ExSpanTooLongException

Throws an exception if the length is out of the range of Int32.