Maximum String Length

G

Guest

Hi All

Simple question but i can't find the answer
What is the maximum length of the String data type in C#
Is it any different when developing in the .net compact framework

Thanks
Dave
 
J

Jon Skeet [C# MVP]

Dave said:
Simple question but i can't find the answer:
What is the maximum length of the String data type in C#?
Is it any different when developing in the .net compact framework?

I suspect it's 2^31-1, i.e. int.MaximumValue.

Suffice to say you're likely to run into memory problems long before
you reach it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top