Few extension methods of String concatenation in C# - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Monday, June 20, 2011

Few extension methods of String concatenation in C#

String concatenation
 
About string concatenation, there are already many articles that have been posted in the web. There are many arguments about string concatenation, for example some people say we should not use +, some says use string.join or StringBuilder. I think all are right because usage of different techniques depend on the situation and expected performance really. I reflect the string.concatmethod using .NET reflector then found
 Collapse
  return (arg0.ToString() + arg1.ToString());
code in where they use + so then what's wrong with the + ? Of course, there are performance issues with +.
 
So I have created few extensions of string to do the concatenation operation which I include below:

No comments:

Post a Comment