2
Reply

What is the difference between System.Text.StringBuilder over System.String?

Arun Singh

Arun Singh

12y
1.2k
0
Reply

    system.string ============= 1-Present in system namespace 2-Here concatenation is used to combine two strings. 3-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 4-we say "Strings are immutable".(cant be change the memory of object its changed by garbagecollector when it runs)(slower performance) =============== system.stringbuilder ================= 1-Present in system. Text namespace 2-Here Append method is used. 3-Insertion is done on the existing string. 4-Its mutable(better performance than string)

    system.string ============= 1-Present in system namespace 2-Here concatenation is used to combine two strings. 3-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 4-we say "Strings are immutable".(cant be change the memory of object its changed by garbagecollector when it runs)(slower performance) =============== system.stringbuilder ================= 1-Present in system. Text namespace 2-Here Append method is used. 3-Insertion is done on the existing string. 4-Its mutable(better performance than string)