C# SortedSet CopyTo(T[])
Description
SortedSet
copies the complete SortedSet
Syntax
SortedSet.CopyTo(T[])
has the following syntax.
public void CopyTo(
T[] array
)
Parameters
SortedSet.CopyTo(T[])
has the following parameters.
array
- A one-dimensional array that is the destination of the elements copied from the SortedSet.
Returns
SortedSet.CopyTo(T[])
method returns
Example
/*from w w w.j a va 2s .c om*/
using System;
using System.Collections.Generic;
public class MainClass
{
public static void Main(String[] argv)
{
SortedSet<int> evenNumbers = new SortedSet<int>();
for (int i = 0; i < 5; i++)
{
evenNumbers.Add(i * 2);
}
int[] intArray = new int[5];
evenNumbers.CopyTo(intArray);
}
}