What’s the advantage of using System.Text.StringBuilder
over System.String?

Answer Posted / jhansi

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 ?    40 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Asp.net mvc application, makes use of settings at 2 places for routing to work correctly. What are these 2 places?

850


Explain RenderBody and RenderPage in ASP.Net MVC?

795


What is the difference between viewbag and viewdata in asp.net mvc?

848


How to update one of my table in database at 4pm every day how it is possible?

756


How can I return string result from action in asp.net mvc?

780


What is code first? : Entity framework

768


What is viewbag?

788


what is entity graph in entity framework?

824


Will there be a .net compact framework 3.0 release with release of .net framework 3.0?

742


what do you mean by table-per-type?

825


What is partialview in asp.net mvc?

791


What is difference between razor and web form engine?

748


what is way of loading data in ef (entity framework)?

784


How to Redirect Tracing to a File

783


I want to fetch data from datareader. i have three tables in datareader. i want to bind my two table with datagrid, then i want to fetch a value from my third table. do u have any idea pls help me. we use dr.nextresult() for multiple tables.

2377