What?s the difference between System.String and
System.StringBuilder classes?
Answers were Sorted based on User's Feedback
Answer / sundarchum
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 ? | 3 Yes | 0 No |
Answer / guest
System.String is immutable, System.StringBuilder was
designed with the purpose of having a mutable string where a
variety of operations can be performed
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / 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 |
What does the parsefloat function do?
When a new instance of a type is created, what is the type of method implicitly called?
What is difference between c and c sharp?
What is use of console?
Why are strings in c# immutable?
What is difference between Method and function
How would you describe encapsulation in c#?
Can you inherit multiple interfaces?
Can you prevent your class from being inherited and becoming a base class for some other classes?
What are generic types?
What are strong name assemblies?
So let's say I have an application that uses myapp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name myapp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new myapp.dll?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)