Method StartsWith
StartsWith<T>(ExSpan<T>, ReadOnlyExSpan<T>)
Determines whether the specified sequence appears at the start of the span.
public static bool StartsWith<T>(this ExSpan<T> span, ReadOnlyExSpan<T> value) where T : IEquatable<T>?
Parameters
spanExSpan<T>valueReadOnlyExSpan<T>
Returns
Type Parameters
T
StartsWith<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>)
Determines whether the specified sequence appears at the start of the span.
public static bool StartsWith<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> value) where T : IEquatable<T>?
Parameters
spanReadOnlyExSpan<T>valueReadOnlyExSpan<T>
Returns
Type Parameters
T
StartsWith<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>, IEqualityComparer<T>?)
Determines whether a specified sequence appears at the start of a read-only span.
public static bool StartsWith<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> value, IEqualityComparer<T>? comparer = null)
Parameters
spanReadOnlyExSpan<T>The source span.
valueReadOnlyExSpan<T>The sequence to compare to the start of
span.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
StartsWith<T>(ReadOnlyExSpan<T>, T)
Determines whether the specified value appears at the start of the span.
public static bool StartsWith<T>(this ReadOnlyExSpan<T> span, T value) where T : IEquatable<T>?
Parameters
spanReadOnlyExSpan<T>The span to search.
valueTThe value to compare.
Returns
Type Parameters
TThe type of elements in the span.
StartsWith<T>(ReadOnlyExSpan<T>, T, IEqualityComparer<T>?)
Determines whether the specified value appears at the start of the span.
public static bool StartsWith<T>(this ReadOnlyExSpan<T> span, T value, IEqualityComparer<T>? comparer = null)
Parameters
spanReadOnlyExSpan<T>The span to search.
valueTThe value to compare.
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
TThe type of elements in the span.
StartsWith(ReadOnlyExSpan<char>, ReadOnlyExSpan<char>, StringComparison)
Determines whether the beginning of the span matches the specified value when compared using the specified comparisonType option.
public static bool StartsWith(this ReadOnlyExSpan<char> span, ReadOnlyExSpan<char> value, StringComparison comparisonType)
Parameters
spanReadOnlyExSpan<char>The source span.
valueReadOnlyExSpan<char>The sequence to compare to the beginning of 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.