What is the Maximum Capacity of a String in .NET

The theoretical capacity of a String maybe 2,147,483,647 (2 Billion),

because the Length property of the String returns an int, so the maximum length of a String is Int32.MaxValue (2,147,483,647) characters.

But in practical,

Since no single object in a .NET program can be over 2GB

[ As with 32-bit Windows operating Sytems, there is a 2GB limit on the size of an object you can create while running a 64-bit Managed Application on a 64-bit Windows Operating System]

As we know that String uses UNICODE which means 2 bytes for each character,

So the best you could achieve is 1,073,741,823 (1 Billion) characters in a String object.

If you go beyond that, you might get into a guy named OutOfMemoryException.

UPDATE: .NET framework 4.5 allows creating arrays of size larger than 2GB on 64-bit platforms.
By default, this feature is not enabled. You have to enable it through the config file using the gcAllowVeryLargeObjects element.

Refer to this for more information : gcAllowVeryLargeObjects