Use StringBuilder or string class for concatenating strings





when you want to concatenate strings you'll think about performance so,
Is StringBuilder faster than strings when concatenating or not ?



StringBuilder is the best performance for a concatenation if an arbitrary number of strings are concatenated, however,  the String class is preferable for a concatenation operation if a fixed number of Strings are concatenated.

Note :
You also need to keep in mind that a new string is created at each concatenation when standard string
concatenation is used.so, think about the number of objects that will be created in memory so,
 This can lead to an explosion of objects for the garbage collector to deal with.


EmoticonEmoticon