Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is the difference between System.String and System.StringBuilder classes?
Difference between System.String & System.StringBuilder Classes?
✍: 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.
prefer System.StringBuilder when you are doing lot of string manuplation operations. In which case the same string in the memory is manipulated for the resultant operation where as when System.String variable is used every time a new string instance is created in the memory
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
2009-03-06, 4874👍, 0💬
Popular Posts:
Assuming that the structure of a table shows two columns like this: --------+------------+-- ----+---...
What will be printed as the result of the operation below: main() { int x=20,y=35; x=y++ + x++; y= +...
How To Control Table Widths? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells Usually, b...
How To Control Table Widths? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells Usually, b...
How To Enter Boolean Values in SQL Statements? - MySQL FAQs - Introduction to SQL Basics If you want...