StartsWith()

System::MemoryExtensions::StartsWith(const ReadOnlySpan<T>&, const T&) function

Checks if the span starts with the specified value.

template<typename T> bool System::MemoryExtensions::StartsWith(const ReadOnlySpan<T> &span, const T &value)

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The span to check
valueconst T&The value to check for at the beginning of the span

Return Value

true if the span starts with the value, false otherwise

System::MemoryExtensions::StartsWith(const ReadOnlySpan<String>&, const char16_t *) function

Checks if a string span starts with the specified character array.

bool System::MemoryExtensions::StartsWith(const ReadOnlySpan<String> &span, const char16_t *val)

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<String>&The string span to check
valconst char16_t *The character array to check for at the beginning

Return Value

true if the span starts with the character array, false otherwise

System::MemoryExtensions::StartsWith(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&) function

Checks if the span starts with the specified value span.

template<typename T> bool System::MemoryExtensions::StartsWith(const ReadOnlySpan<T> &span, const ReadOnlySpan<T> &value)

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The span to check
valueconst ReadOnlySpan<T>&The span containing values to check for at the beginning

Return Value

true if the span starts with the value span, false otherwise

System::MemoryExtensions::StartsWith(const Span<T>&, const ReadOnlySpan<T>&) function

Checks if the mutable span starts with the specified read-only value span.

template<typename T> bool System::MemoryExtensions::StartsWith(const Span<T> &span, const ReadOnlySpan<T> &value)

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
spanconst Span<T>&The mutable span to check
valueconst ReadOnlySpan<T>&The read-only span containing values to check for

Return Value

true if the span starts with the value span, false otherwise

System::MemoryExtensions::StartsWith(const ReadOnlySpan<T>&, const Span<T>&) function

Checks if the read-only span starts with the specified mutable value span.

template<typename T> bool System::MemoryExtensions::StartsWith(const ReadOnlySpan<T> &span, const Span<T> &value)

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The read-only span to check
valueconst Span<T>&The mutable span containing values to check for

Return Value

true if the span starts with the value span, false otherwise

System::MemoryExtensions::StartsWith(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison) function

Checks if the character span starts with the specified value span using string comparison.

bool System::MemoryExtensions::StartsWith(const ReadOnlySpan<char16_t> &span, const ReadOnlySpan<char16_t> &value, StringComparison comparisonType)

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<char16_t>&The character span to check
valueconst ReadOnlySpan<char16_t>&The character span containing values to check for
comparisonTypeStringComparisonThe type of string comparison to perform

Return Value

true if the span starts with the value span, false otherwise

See Also