227 Views
We all know that the way .net handles a string is not optimal and uses up lot of memory, thought there are reason to do like this. But if we have more string objects or comparison inside our assembly then in this case surely it is going to be a performance hit. But here what really happens is framework itself take cares at least some part of it using the concept of Sting Interning. So what is String interning in Microsoft .net. How does it helps the C# code Execution.. It seems that there is an internal hashtable maintained with the actual string value and it’s reference to managed heap. And two methods help us to handle this hash table This is the “Intern” and “IsInterned” methods which is part of string manipulation class.