WHAT ARE DIFFERENCES BETWEEN SYSTEM.STRINGBUILDER AND SYSTEM.STRING?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
C#  .NET  String 
 954  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What are differences between system.stringbuilder and system.string?

    The main difference is system.string is immutable and system.stringbuilder is a mutable. Append keyword is used in string builder but not in system.string.

    Immutable means once we created we cannot modified. Suppose if we want give new value to old value simply it will discarded the old value and it will create new instance in memory to hold the new value.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!