Understanding Strings in C#(sanjevsharma.blogspot.com)
submitted by
sanjev.sharma(579) 4 years, 10 months ago
Strings are immutable, which means that they cannot be changed in memory. So if we append something to a string, the .Net Framework will actually reserve memory for a new string of the total desired length and then copy the original string and the new string into it. So long as the original strings are still reference, they will not be garbage-collected. We never think of this while appending to a string!!
|category: C#
|Views: 3
tags:
another
Everyones tags:
No tags
Your Tags: