Get<>(dict, key, defaultVal) Get<>(dict, key, defaultVal) Get<>(dict, key1, key2, defaultVal) IndexOfSubarray<>(sourceArray, findWhat, startIndex, sourceLength, comparer) Insert<>(array, startIndex, values) Insert<>(array, startIndex, value) Remove<>(array, startIndex, length) SubarrayEquals<>(sourceArray, sourceStartIndex, otherArray, otherStartIndex, length, comparer)
Legend Class Struct Enum Interface Delegate | Constructor Method Property Event Field |
| Extension method: int IndexOfSubarray<T>(this T[], T[], int, int?, IEqualityComparer<T>)Declarationpublic static int IndexOfSubarray<T>(
this T[] sourceArray,
T[] findWhat,
int startIndex,
int? sourceLength = null,
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| T | This type parameter is not documented. |
Parameters| this T[] | sourceArray |
Array in which to search for the subarray. | | T[] | findWhat |
Subarray to search for. | | int | startIndex |
Index in sourceArray at which to start searching. | | int? | sourceLength |
Maximum length of the source array to search starting from startIndex. The greatest index
that can be returned is this minus the length of findWhat plus startIndex. | | IEqualityComparer<T> | comparer |
Optional equality comparer. |
Returns
The index of the first match, or -1 if no match is found. |