LastIndexOf()

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

Finds the last occurrence of a value within a span using specified string comparison.

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

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<char16_t>&The span to search within
valueconst ReadOnlySpan<char16_t>&The value to search for
comparisonTypeStringComparisonThe type of string comparison to perform

Return Value

The zero-based index of the last occurrence, or -1 if not found

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

Finds the last occurrence of a sequence within a span.

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

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The span to search within
valueconst ReadOnlySpan<T>&The sequence to search for

Return Value

The zero-based index of the last occurrence, or -1 if not found

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

Finds the last occurrence of a single value within a span.

template<typename T> int32_t System::MemoryExtensions::LastIndexOf(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 search within
valueconst T&The value to search for

Return Value

The zero-based index of the last occurrence, or -1 if not found

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

Finds the last occurrence of a sequence within a mutable span.

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

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanconst Span<T>&The span to search within
valueconst ReadOnlySpan<T>&The sequence to search for

Return Value

The zero-based index of the last occurrence, or -1 if not found

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

Finds the last occurrence of a single value within a mutable span.

template<typename T> int32_t System::MemoryExtensions::LastIndexOf(const Span<T> &span, const T &value)

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanconst Span<T>&The span to search within
valueconst T&The value to search for

Return Value

The zero-based index of the last occurrence, or -1 if not found

See Also