CSharp examples for System.Collections:ICollection
ICollection To Array
using System.Text; using System.Collections.Generic; using System;// w w w . ja v a 2 s . co m public class Main{ public static T[] ToArray<T>(this ICollection<T> collection, Int32 index = 0) { lock (collection) { var arr = new T[collection.Count - index]; collection.CopyTo(arr, index); return arr; } } }