What?s the difference between System.String and
System.StringBuilder classes?
Answer Posted / akash
Both the String and StringBuilder class are used to store
strings. One exception is when we change the value in the
string it will create a new String object is creating in
memory and assign the new value.
eg: String name = "Sundar";
A new name object is creating in memory and the
value "Sundar Rahul" is assinging to the newly created
space.
eg: String name = "Sundar Rahul";
But StringBuilder class occupies the same space even if you
change the value.
StringBuilder gives you better performance than String
class when you perform string manipulations like string
concatenation.
You can use StringBuilder's Append() method to use
concatenation and for String use "+".
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is the meaning of Object lifetime in OOPS
What do u mean by delegation of authority?
What is exe file in c#?
What is the C# syntax to catch any possible exception?
What is deadly diamond problem?
List down the access modifiers available in c#?
Describe two uses of the “using” statement during the operation of c#?
Is 0 an unsigned integer?
What is ilasm.exe used for?
What is dll file in c#?
how to Create a datagridview control with check box column with 8rows in it, the maximum number of check boxes checked should be 3, when user checks the 4th corresponding message should be displayed and check box should be checked. User can uncheck the checked boxes Note: read-only property should not be used
What is a must for multitasking
Why it's said that writing into .NET Application Configuration Files is a Bad Idea?
How to get the sum of last 3 items in a list using lambda expressions?
How do you define a predicate?