CSharp examples for System:Array Element
Generate array from function
using System;// www . jav a 2 s .c o m public class Main{ public static T[] Generate<T>(int count, Func<int, T> elementGenerator) { var table = new T[count]; for (int i = 0; i < count; i++) { table[i] = elementGenerator(i); } return table; } }