---
title: "What are the differences between System.String and System.Text.StringBuilder classes?"  
description: "What are the differences between System.String and System.Text.StringBuilder classes?"  
author: "Samuel Fernandes"  
published: 2017-08-23  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/23288/what-are-the-differences-between-system-string-and-system-text-stringbuilder-classes  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# What are the differences between System.String and System.Text.StringBuilder classes?

**System.String is immutable.** When we modify the value of a string variable then a new memory is allocated to the new value and the previous memory allocation released.

System.StringBuilder was designed to have concept of a mutable string where a variety of operations can be performed without allocation separate memory location for the modified string.

## Answers

### Answer by Samuel Fernandes

**System.String is immutable.** When we modify the value of a string variable then a new memory is allocated to the new value and the previous memory allocation released.

System.StringBuilder was designed to have concept of a mutable string where a variety of operations can be performed without allocation separate memory location for the modified string.


---

Original Source: https://www.mindstick.com/interview/23288/what-are-the-differences-between-system-string-and-system-text-stringbuilder-classes

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
