<p>What is the longest string that can be created in .NET? The docs for the <code>String</code> class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system?</p>

<p>[This is asked more for curiosity than for practical use - I don't intend to create any code that uses gigantic strings!]</p>

Since the
```
Length
```
property of
```
System.String
```
is an
```
Int32
```
, I would guess that that the maximum length would be 2,147,483,647 chars (max
```
Int32
```
size). If it allowed longer you couldn't check the Length since that would fail.