Building String

  • I am building a string for a series of smaller strings. Which option is more efficient ?

    Build the string using the & Operator

    Build the string using the StringBuilder Object

    Build the string using StringCreator Object

    Build the string using the += Operator

  • These look like C# of VB.NET questions, not SQL Server.

    You can test these, write a loop to build 10,000 of each one, look at the cost/time of each.

  • Like Steve said, this may be better suited for the .Net forums, but just like everything. It depends. I rarely use StringBuilder when I code. I only use it when I have a lot of concatenation to do. I don't think there is any difference between + and & other than syntax.

    This article has some good guidelines.

    http://www.yoda.arachsys.com/csharp/stringbuilder.html

  • Thanks for the article Ken it was really helpful.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply