John Baird
Coatesville, Pennsylvanie, États-Unis
>>Question: I've always been confused about how the compiler optimizes string concatonation. Should you be using String.Format or String.Concat instead of the way you're doing it? Or will the compiler optimize it?
>
>
>For short strings, as in the demo, i don't think it matters.... but for the most part I use stringbuilder to concat long strings of data.....
AFAIR it is more a question of the no. of strings involved.
Methinks up to 4 operands of type string are better optimized than stringbuffer.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement