What’s the difference between System.String and
System.Text.StringBuilder classes with example

Answer Posted / puneet mishra

according to me difference between a string class and using String Builder is that in using a string class you need to create new object befour appending it to the main string but in string builder class one don`t need to create object every time

Example for string builder class:
using System.Text;

stringBuilder str = new stringBuilder;
str.append("");

in the previous example once u create str as new instance of string builder class u just have to append every thing in to the string

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is nullable type c#?

496


What are constructors in c#?

543


What is a singleton unity?

558


What is a method signature in c#?

513


What is the difference between int and int in c#?

497






What is the difference between protected and private?

469


Explain the Different types of configuration files in .net?

577


What is void in c#?

535


Is there a way of specifying which block or loop to break out of when working with nested loops?

547


what is method overloading in c#?

544


how background thread access to ui control?

593


Can constructor have return type c#?

644


How many static constructors are allowed in a class?

484


What are synchronous and asynchronous operations?

480


How do I move from one form to another in c#?

469