Switching back and forth between mainly Delphi and C#, sometimes it is hard to remember which idiom works best in each environment.
Recently, I had to dupe a lot of tab characters for some Tab-Delimited interface to an archaic system.
I remembered the Delphi idiom: use the DupeString function as about Delphi explains (yes, I know: it dupes more than just characters).
In C#, these work best for me:
Small code sample of the first way (thanks CMS):
static string Tabs(int n)
{
return new String('\t', n);
}
–jeroen
via: .net – Best way to repeat a character in C# – Stack Overflow.
Oh BTW: I have reduced my StackOverflow presence. It looks like the success of StackOverflow made them instantiate many moderators. A lot of those moderators work under the mantra “we follow the rules strictly, and favour punishment over encouragement” (some even talk about “changing heritage“). That’s a real pity, as I see a lot of StackOverflow users get scared by the very active downvoting, question/answer closing and even deletion of material that is in essence valuable, if it were edited up a bit. Deleting content is always bad, as it increases the link rot that StackOverflow are trying to prevent in questions/answers as per their FAQ. Links are the foundation of the web.
Alas, devoting real attention to the quality of StackOverflow requires putting real energy in it, which for some of the moderators seems to be too much to ask.
Like this:
Like Loading...