C # string has a length limit

Possible duplicate:
What is the maximum length of a .NET string?

Is there a limit to a C # line for storing data?

+7
source share
2 answers

Strings cannot contain more than two characters 31 because String.Length is a 32-bit integer.

They are also limited by available memory.

+12
source

string.Length is int, so the string can contain Int.MaxInt bytes - 2,147,483,647

+1
source

All Articles