What is the difference between a mutable and immutable string in C# and VB.NET?
Mutable is the english word for can change. Immutable is the english word for cannot change.
if you alter a String, you are creating a new string object internally. So String is immutable. If you alter a StringBuilder no new Objects are created internally so, StringBuilder is mutable.
RT @CodeSnippetsNET: What is the difference between mutable and immutable in C# and #VB .NET http://t.co/ekw0af4Xqo #csharp #dotnet #visual…
RT @CodeSnippetsNET: What is the difference between mutable and immutable in C# and #VB .NET http://t.co/ekw0af4Xqo #csharp #dotnet #visual…
RT @CodeSnippetsNET: What is the difference between mutable and immutable in C# and #VB .NET http://t.co/ekw0af4Xqo #csharp #dotnet #visual…
RT @CodeSnippetsNET: What is the difference between mutable and immutable in C# and #VB .NET http://t.co/ekw0af4Xqo #csharp #dotnet #visual…
@CodeSnippetsNET @AllCodeSnippets I recall mutable doesn’t allow you to change the value after being set. #EducatedGuess
RT @CodeSnippetsNET: What is the difference between mutable and immutable in C# and #VB .NET http://t.co/ekw0af4Xqo #csharp #dotnet #visual…
Mutable: Mutable means whose state can be changed after it is created.
Immutable: Immutable means whose state cannot be changed once it is created.
String objects are ‘immutable’ it means we cannot modify the characters contained in string also operation on string produce a modified version rather than modifying characters of string.
Use Reference
imaginationhunt.blogspot
IS STRING MUTABLE OR IMMUTABLE IN .NET?
http://imaginationhunt.blogspot.in/2015/06/is-string-mutable-or-immutable-in-net.html