latest Post

Difference Between String And StringBuilder in C#


String 

It is Immutable.

String Using System NameSpaces.

Once Create String Object We Cannot Modify.

String Cannot Append Keyword.

String is Slower Than StringBuilder Because Create New Instance
for Every Time.

e.g
string a = "10";
string b = "22";
string c = a + b;



StringBuilder 

It is Mutable.

StringBuilder Using System.Text Namespaces.

Once Create String Builder Object We Can Perform Any Operation.
e.g Insert, Replace, Append.

StringBuilder Can Append Keyword.

StringBuilder is Faster Than String Because Create One Instance
for Every Time

e.g
StringBuilder S = new StringBuilder("");
S.Append("");
S.Append("MBOX ");
string c = S.ToString();



Find us on facebook:  https://www.facebook.com/mboxtuts Like this page for more cool stuff.

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment