Possible Duplicate:
Is there an easy way to return a string repeated X number of times?
If I want to display a dot 10 times in Python, I could either use this:
print ".........."
or this
print "." * 10
How do I use the second method in C#? I tried variations of:
Console.WriteLine("."*10);
but none of them worked. Thanks.
You can use the string
constructor:
Console.WriteLine(new string('.', 10));
Initializes a new instance of the String class to the value indicated by a specified Unicode character repeated a specified number of times.