StringBuilder can be used where more than four or more string concatenations take place.
String to do some manipulation (remove and replace a part from the string)
String
|
StringBuilder
|
immutable
|
mutable
|
Performance slow because every time will
create new instance
|
Performance high because it will use same
instance of object to perform any action
|
String belongs to System namespace
|
Stringbuilder belongs to System.Text namespace
|
No comments:
Post a Comment