Table of Contents

Method Contains

Namespace
Zyl.ExSpans
Assembly
ExSpans.dll

Contains<T>(ExSpan<T>, T)

Searches for the specified value and returns true if found. If not found, returns false. Values are compared using IEquatable{T}.Equals(T).

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

Parameters

span ExSpan<T>

The span to search.

value T

The value to search for.

Returns

bool

Type Parameters

T

Contains<T>(ReadOnlyExSpan<T>, T)

Searches for the specified value and returns true if found. If not found, returns false. Values are compared using IEquatable{T}.Equals(T).

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

Parameters

span ReadOnlyExSpan<T>

The span to search.

value T

The value to search for.

Returns

bool

Type Parameters

T

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

Searches for the specified value and returns true if found. If not found, returns false.

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

Parameters

span ReadOnlyExSpan<T>

The span to search.

value T

The value to search for.

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

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

Returns a value indicating whether the specified value occurs within the span.

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

Parameters

span ReadOnlyExSpan<char>

The source span.

value ReadOnlyExSpan<char>

The value to seek within 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.