What is the Main difference between String and
StringBuilder and why do we use StringBuilder.
Answer Posted / praveen kumar a
Strings are so heavily used in all programming languages
that we do not think about them very much.Normally all goes
well but sometimes we need more performance so we switch to
StringBuilder which is more efficient because it does
contain a mutable string buffer. .NET Strings are immutable
which is the reason why a new string object is created
every time we alter it (insert, append, remove, etc.).
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Are arrays immutable c#?
Can you have parameters for static constructors?
What is data reader in c#?
What are the types of operator?
Differentiate between copy and default constructor.
Which is the base class in c#?
What is generic method in c#?
What do you mean by saying a "struct is a value type"?
What is datetime minvalue in c#?
Is array thread safe c#?
Why do we use virtual methods in c#?
What .exe means?
Define assert() method? How does it work?
Can bool be null c#?
Suppose two interfaces have same method, so how will you implement these methods in derive class?