Method Contains
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
spanExSpan<T>The span to search.
valueTThe value to search for.
Returns
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
spanReadOnlyExSpan<T>The span to search.
valueTThe value to search for.
Returns
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
spanReadOnlyExSpan<T>The span to search.
valueTThe value to search for.
comparerIEqualityComparer<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
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
spanReadOnlyExSpan<char>The source span.
valueReadOnlyExSpan<char>The value to seek within the source span.
comparisonTypeStringComparisonOne of the enumeration values that determines how the
spanandvalueare compared.
Returns
Exceptions
- ExSpanTooLongException
Throws an exception if the length is out of the range of Int32.