Difference Between String and StringBuilder In C#

preview_player
Показать описание
C# tutorial on the difference between string and StringBuilder(string vs StringBuilder).

Main Differences.

1) NameSpace

StringBuilder belongs to System.Text Namespace and that of the string is System.

2) Mutability and Immutability

String is mutable and StringBuilder is immutable.

The mutability of string can be explained as a process for creating new instances when an operation on it changes its value. While StringBuilder does not create new fresh instances like a string instead it overwrite existing instance.

3) Performance

One Last Point

📂 GitHub Repository

💖 Buy me a Coffee

🌀 Related Videos

🔗 Find me in

#CSharp #CodAffection
Рекомендации по теме
Комментарии
Автор

A heads up: At point 2) of the description you've accidentally specified string as mutable when it's the other way around.

aresdragoj