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.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IList<T> Range<T>(
T[] array,
int start,
int count
)
public:
generic<typename T>
static IList<T>^ Range(
array<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:
IListTA list that is a view onto the given sub-array.
Exceptions
RemarksThis 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