ArrayExtensions.WrapIndex

Extension Method in ArrayExtensions

Declaration

public static int WrapIndex(this Array array, int index)

Description

Wraps an index to either end of the array if it is out of bounds.

Parameters

arrayThe array to wrap.
indexThe index to wrap.

Returns

intThe wrapped index.