Given a List in c# is there a way to extend it (within its capacity) and set the new elements to null? I\'d like something that works like
List
null
static IEnumerable GetValues(T value, int count) { for (int i = 0; i < count; ++i) yield return value; } list.AddRange(GetValues(null, number_of_nulls_to_add));
This will work with 2.0+