System.String
is a very special type. It's the only type in .NET other than arrays where different instances can have different sizes. (Anything else which "appears" to have different sizes such as List<T>
usually depends on an array, or some recursive type like a LinkedList
node. The objects themselves are of a fixed size.) The character data is inline within the object itself, along with the length of the string. It's not like a String
holds a reference to a char[]
or similar.
The CLR has very deep knowledge of System.String
, and a lot of it is implemented in native code. Basically, I would recommend against trying to understand the implementation at this point - it's likely to be more confusing than helpful.
The Chars
member (the indexer in C#) only fetches a single character from the string. You could follow that to find out more about where the data is stored, but it doesn't perform the actual storage itself.