Construct (Create) a String From Repeating Char or String

When we need repeating activities we use loops. But loops need more lines.

If you write the code below you get a string from repeating string or char. you just give the count that you want. (i now this is not a very genious case)

You may want to use this.

string repeatativeString = string.Concat(
System.Collections.ArrayList.Repeat(" ", 60).ToArray());
string repeatativeChar = new string('-', 60);
  • Facebook
  • Twitter
  • StumbleUpon
  • del.icio.us
  • Digg

Category: Csharp - C# - Comment »


Leave a Reply



Back to top