C# string Vs StringBuilder

The Coding Hub
1 min readOct 20, 2021

In C# String builder is used to represent a mutable string of characters. Mutable means a string that can be changed. So string objects are immutable and String Builder objects are mutable.

In practice what this means is that when you make a change to a string object that has already been instantiated, the compiler would create a new memory allocation for it. This can become very bad if you are doing something like…

--

--

The Coding Hub

The Coding Hub: Your go-to programming tutorial and learning expert. Simplifying the world of coding for all levels. C# , JavaScript, TypeScript, and more!