Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: int IndexOfSubarray<T>(this T[], T[], IEqualityComparer<T>)

Declaration

public static int IndexOfSubarray<T>(
    this T[] sourceArray,
    T[] findWhat,
    IEqualityComparer<T> comparer = null
)

Summary

Searches the current array for a specified subarray and returns the index of the first occurrence, or -1 if not found.

Generic type parameters

TThis type parameter is not documented.

Parameters

this T[]sourceArray Array in which to search for the subarray.
T[]findWhat Subarray to search for.
IEqualityComparer<T>comparer Optional equality comparer.

Returns

The index of the first match, or -1 if no match is found.