C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

What is difference between System.String and System.StringBuilder classes?

0 votes
53 views
asked Feb 24, 2014 by keem Expert (13,240 points)

1 Answer

0 votes
String and StringBuilder classes are used to store string values but the difference in them is that String is immutable (read only) by nature, because a value once assigned to a String object cannot be changed after its creation. When the value in the String object is modified, a new object is created, in memory, with a new value assigned to the String object. On the other hand, the StringBuilder class is mutable, as it occupies the same space even if you change the value. The StringBuilder class is more efficient where you have to perform a large amount of string manipulation.
 
answered Feb 24, 2014 by sara Guru (24,570 points)

Related questions

0 votes
1 answer 15 views
0 votes
1 answer 105 views
105 views asked Oct 15, 2011 by shivani Sr Member (1,090 points)
0 votes
1 answer 34 views
34 views asked Feb 24, 2014 by sara Guru (24,570 points)
0 votes
1 answer 383 views
383 views asked Nov 16, 2011 by shivani Sr Member (1,090 points)
0 votes
1 answer 38 views
38 views asked Apr 8, 2014 by rock Expert (14,990 points)
...