IndexOf()

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

Finds the index of a ReadOnlySpan<char16_t> value in a ReadOnlySpan<char16_t> with StringComparison.

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

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<char16_t>&The span to search in
valueconst ReadOnlySpan<char16_t>&The value to search for
comparisonTypeStringComparisonThe string comparison type to use

Return Value

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

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

Finds the index of a ReadOnlySpan value in another ReadOnlySpan

template<typename T> int32_t System::MemoryExtensions::IndexOf(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 search in
valueconst ReadOnlySpan<T>&The span to search for

Return Value

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

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

Finds the index of a single value in a ReadOnlySpan

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

Return Value

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

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

Finds the index of a ReadOnlySpan value in a Span

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

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

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

Return Value

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

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

Finds the index of a single value in a Span

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

Return Value

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

See Also