What is the maximum length of a string. I am trying to store a document in a variable and my plan was to use a string, but I don't know what the maximum length is. If there is one, is there a better way to store a 500 word document in a variable?
You may find that (depending on version) your string limit is actually closer to 32K. At least, this is the maximum you can display in a text box... so I'd take that as the practical limit if UI is involved.
I can't say that I have ever come across a problem with a string getting too long, but I did find the following article that indicates that the max length is something approaching UInt32.Max. http://www.codeproject.com/dotnet/strings.asp
If you document is only 500 words then it should be well within the realms of being stored within a String variable.