Click or drag to resize
AlgorithmsRangeT Method (T, Int32, Int32)
Returns a view onto a sub-range of an array. Items from array are not copied; the returned IList<T> is simply a different view onto the same underlying items. Changes to array are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the view. After an insertion, the last item in array "falls off the end". After a deletion, the last item in array becomes the default value (0 or null).

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static IList<T> Range<T>(
	T[] array,
	int start,
	int count
)

Parameters

array
Type: T
The array to view.
start
Type: SystemInt32
The starting index of the view.
count
Type: SystemInt32
The number of items in the view.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.Range``1(``0[],System.Int32,System.Int32)"]

Return Value

Type: IListT
A list that is a view onto the given sub-array.
Exceptions
ExceptionCondition
ArgumentNullExceptionarray is null.
ArgumentOutOfRangeExceptionstart or count is negative.
ArgumentOutOfRangeExceptionstart + count is greater than the size of array.
Remarks
This method can be used to apply an algorithm to a portion of a array. For example:
Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6))
will reverse the 6 items beginning at index 3.
See Also