AlgorithmsToArrayT Method |
Create an array with the items in a collection.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static T[] ToArray<T>(
IEnumerable<T> collection
)
public:
generic<typename T>
static array<T>^ ToArray(
IEnumerable<T>^ collection
)
Parameters
- collection
- Type: System.Collections.GenericIEnumerableT
Collection to create array from.
Type Parameters
- T
- Element type of the collection.
Return Value
Type:
TAn array with the items from the collection, in enumeration order.
Exceptions
RemarksIf collection implements ICollection<T>T, then
ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator()
is used to fill the array.
See Also