RuntimeHelpers.GetSubArray<T>(T[], Range) Method

Definition

Slices the specified array using the specified range.

C#
public static T[] GetSubArray<T>(T[] array, Range range);

Type Parameters

T

The type of the elements in the array.

Parameters

array
T[]

The array to slice.

range
Range

An object that determines the portion of array to include in the slice.

Returns

T[]

The subarray defined by range.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1