AlgorithmsRangeT Method (IListT, Int32, Int32) |
Returns a view onto a sub-range of a list. Items from list are not copied; the
returned IList<T> is simply a different view onto the same underlying items. Changes to list
are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the
view, but insertions and deletions in the underlying list do not.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IList<T> Range<T>(
IList<T> list,
int start,
int count
)
public:
generic<typename T>
static IList<T>^ Range(
IList<T>^ list,
int start,
int count
)
Parameters
- list
- Type: System.Collections.GenericIListT
The list to view. - start
- Type: SystemInt32
The starting index of the view. - count
- Type: SystemInt32
The number of items in the view.
Type Parameters
- T
- The type of the items in the list.
Return Value
Type:
IListTA list that is a view onto the given sub-list.
Exceptions
RemarksThis method can be used to apply an algorithm to a portion of a list. For example:
Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6))
will reverse the 6 items beginning at index 3.
See Also