Mono Class Library: System.Collections.ArrayList Overview | Members

System.Collections.ArrayList.Repeat Method

Returns a new ArrayList whose elements are copies of the specified object.

public static ArrayList Repeat (object value, int count)

Parameters

value
The object used to initialize the new ArrayList instance.
count
A int that specifies the number of times value is copied into the new ArrayList instance.

Returns

A new ArrayList with count number of elements, all of which are copies of value.

Exceptions

TypeReason
ArgumentOutOfRangeExceptioncount < 0.

Remarks

If count is less than the default initial capacity, 16, the ArrayList.Capacity of the new ArrayList instance is set to the default initial capacity. Otherwise, the capacity is set to count . The ArrayList.Count of the new instance is set to count.

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0