CSharp examples for System.Collections.Generic:IList
N Copies element in IList
using System.Collections.ObjectModel; using System.Collections.Generic; using System.Collections; public class Main{ public static IList<T> NCopies<T> (int n, T elem) {// w w w . j a v a 2 s .c o m List<T> list = new List<T> (n); while (n-- > 0) { list.Add (elem); } return list; } }