What is the maximum possible length of a .NET string?

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 answer might require some knowledge of internals. Would the maximum change on a 64-bit system?

[This is asked more for curiosity than for practical use – I don’t intend to create any code that uses gigantic strings!]

8 Answers
8

Leave a Comment