System.Collections.ArrayList.Repeat C# (CSharp) Method

Repeat() public static method

public static Repeat ( Object value, int count ) : ArrayList
value Object
count int
return ArrayList
        public static ArrayList Repeat(Object value, int count)
        {
            if (count < 0)
                throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
            Contract.Ensures(Contract.Result<ArrayList>() != null);
            Contract.EndContractBlock();

            ArrayList list = new ArrayList((count > _defaultCapacity) ? count : _defaultCapacity);
            for (int i = 0; i < count; i++)
                list.Add(value);
            return list;
        }