CSharp examples for System.Collections.Generic:IEnumerable
Cast IEnumerable To Array
using System.Linq; using System.Collections.Generic; public class Main{ public static T[] CastOrToArray<T>(this IEnumerable<T> source) {//w w w. j a v a2 s .co m return source as T[] ?? source.ToArray(); } }