Using string.Format for simple things?

Posted by Gerrie Schenck on Stack Overflow See other posts from Stack Overflow or by Gerrie Schenck
Published on 2010-03-19T15:09:34Z Indexed on 2010/03/19 15:11 UTC
Read the original article Hit count: 298

In my early .Net programming days, I used string.Format() only for complex string concatenations, for example to compile strings as

Problem with customer order 234 of date 2/2/2002 and payment id 55543.

But now I use string.Format for almost every string concatenation I have to do, also simple ones such as prefixing a string with something.

Console.WriteLine(string.Format("\t\t{0}", myString));

Is there any possible overhead on this? Maybe I should use the regular + operator to do these simple operations?

What's your opinion on this?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about string-concatenation