To fill a string variable, sometimes, they use next way: const string breakLine = "----------";
Seems, next way (usage one of string’s constructor) will be better:
string line = new string('-', 10);
Console.WriteLine("new string('-', 10) >" + line);
Console Output:
1 comment:
Nice trick,
Hope I knew that before, would
have made much clearer code.
thx.
Post a Comment