What is the longest string that can be created in .NET? The docs for the String class are silent on this question as far as I can see, so an authoritative answe
String
String allocates dynamic memory size in the heap of your RAM. But string address is stored in stack that occupies 4 bytes of memory.
Since String.Length is an integer (that is an alias for Int32), its size is limited to Int32.MaxValue unicode characters. ;-)
String.Length
Int32
Int32.MaxValue