Repeat works only with integers.
Repeat accepts the number to repeat, and the number of iterations:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main()
{
foreach (int i in Enumerable.Repeat(5, 3))
{
Console.Write(i + " "); // 5 5 5
}
}
}
The output:
5 5 5
| w_ww_.j_a__v__a2_s__.c___o___m_ | Contact Us |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |