ArrayExtensions.Slice<T>

Extension Method in ArrayExtensions

Declaration

public static T[] Slice<T>(this T[] array, int amount)

Description

Returns a portion of the array containing a specified amount of elements.

Type Parameters

TThe type of the array.

Parameters

arrayThe array to slice.
amountThe amount of elements to slice.

Returns

T[]A new array containing only the sliced elements.