Again, I believe my question about string concat was incorrectly closed as Duplicate.

Why? As stated in the comments:

In fairness, that is definitely not a duplicate question - it focuses on why StringBuilder is faster than separate string concatenations, not on this specific question on why the alternative syntax also works on StringBuilder and whether the two are functionally identical. Also, there's some stuff in that other topic that isn't entirely true. In a well-prepared case multiple concatenations will never outperform StringBuilder, if you select it's initial capacity correctly with the alternative constructor.

On the top of my question I can read:

And then go see the duplicate question and read:

I know the obvious performance advantage to using the StringBuilder is in C#

Well I don't know them and it's kind of the point of my question. Can someone take a few seconds to look at it?

closed as off-topic by random, James, Martijn Pieters, Scimonster, CRABOLO Dec 19 '14 at 9:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question pertains only to a specific site in the Stack Exchange Network. Questions on Meta Stack Exchange should pertain to our network or software that drives it as a whole, within the guidelines defined in the help center. You should ask this question on the meta site where your concern originated." – random, James, Martijn Pieters, Scimonster, CRABOLO
If this question can be reworded to fit the rules in the help center, please edit the question.


The answers for the duplicate question answers your question, even if the two questions are slightly different.

Your question is whether you should use string concatenation or a stringbuilder, when, and why, and that's exactly what the answers in the other questions answer. The OP of that other question is asking for something more in depth, yes, but the answers don't assume much in the way of previous knowledge of the subject on the reader.

Since the answers answer your question, even though the questions are a bit different, closing it as a duplicate is appropriate.


Note the text:

This question already has an answer here:

And note the beginning of the highest upvoted and accepted answer:

Short answer: StringBuilder is appropriate in cases where...

And your question, for reference:

Should I use append line or += [duplicate]

This is correct.

Now that being said, I don't actually know what to do about the original question. I edited its title to more precisely reflect the question being asked. Then it ends with "As a sidenote..." which is frowned upon and puts it in NARQ territory. But then the accepted answer doesn't answer the question at all and answers your question. Honestly the best thing to do is probably heavily revise the question to match the accepted answer, so if someone tries to ask the question's actual question they don't refer to this one, which has no answer.

  • 2
    The actual body of the question says "Should I use AppendLine or += and why", while the linked question is only "Does StringBuilder use more memory than String concatenation?", which addresses one factor of when you should use StringBuilder over +=. Its possible the OP is looking for other reasons than just memory usage. – Rachel May 3 '13 at 14:54
  • @Rachel it seems like they don't understand what I meant. But it's ok that's how it works around here. It looks like a duplicate so it is treated as so. – ʞunɥdɐpɐɥd May 3 '13 at 15:07

Not the answer you're looking for? Browse other questions tagged .