C# String Theory—String intern pool |Visual C# Tutorials| String
intern pool The string intern pool is a table that contains a
single reference to each unique literal string declared or
created programmatically in your application. The Common
Language Runtime (CLR) uses the intern pool to minimize string
storage requirements. As a result, an instance of a literal
string with a particular value only exists once in the system.
For example, if you assign the same literal string to several
different variables, at runtime, the CLR retrieves the unique
reference to that literal string from the intern pool and
assigns it to each variable. String.Intern (string) method
searches the intern pool for a string equal to the specified
value. If such a string exists, its reference in the intern pool
is returned. Otherwise, a reference to the specified string is
added to the intern pool and that reference is returned. In the
following example, the string, declared with a value of "Intern
pool" is interned; because, it is a s