Even though StringBuilder has its Advantage.They have to used Properly.
var FName = Console.ReadLine(); var LName = Console.ReadLine(); /* * Less Time Consuming and Fast. */ String Name = "FirstName" + FName + "LastName" + LName; /* * Bad Code,since operation is time consuming though its efficient. */</p><p>StringBuilder builder=new StringBuilder(); builder.Append("FirstName"); builder.Append(FName); builder.Append("LastName"); builder.Append(LName);</p><p>
1. StringBuilder are ideally suited when you iterate over the string operation for vast number of times.
2.String Concat are better way if you know the literals that have to be concatenated and if they are compile time constant