CSharp examples for System:Array Convert
Convert HashSet To Array
using System.Reflection; using System.Linq; using System.Collections.Generic; using System;// w w w . ja v a 2 s.c om public class Main{ /// <summary> /// For unexplainable reasons, HashSet's ToArray method is internal /// </summary> public static T[] MakeArray<T>(this HashSet<T> set) { var arr = new T[set.Count]; var i = 0; foreach (var item in set) { arr[i++] = item; } return arr; } }