What is the Main difference between String and
StringBuilder and why do we use StringBuilder.
Answer Posted / ankur prasad gupta
Difference..
String..
1.Its a class used to handle strings.
2.Here concatenation is used to combine two strings.
3.String object is used to concatenate two strings.
4.The first string is combined to the other string by creating a new copy in the memory as a string object, and then the old
string is deleted
5.we say "Strings are immutable".
String Builder..
1.This is also the class used to handle strings.
2.Here Append method is used.
3.Here, Stringbuilder object is used.
4.Insertion is done on the existing string.
5.Usage of StringBuilder is more efficient in case large amounts of string manipulations have to be performed
| Is This Answer Correct ? | 19 Yes | 6 No |
Post New Answer View All Answers
What is console readkey in vb net?
What is the difference between dll and lib?
Explain clr in brief.
What do you mean by stack and heap in c#?
What is an assembly loader?
List the 5 different access modifiers in c#?
What does .length do in c#?
Please explain the basic string operations used in c#?
Write a syntax for writing a event delegate.
What is jagged array?
What is a delegate? How can it works?
Helo , Help Me , Help Me About : C# Windows Application - Network How To Manage IP Client's Accessiblity To The Internet Share concise Substitute , Minor ISA Server
Is learning c# hard?
What do you mean by a windows process in regards to memory allocation?
Are c and c# the same thing?