I've got this code that read in a text file into a string
private void Read(string path)
{
StreamReader sr = new StreamReader(path);
data = sr.ReadToEnd();
data = data.ToUpper();
sr.Close();
}
it works all right with a small text file, say 1kb. But when I tried to read a 350KB text file, say a copy of The Lord of The Rings, then it fail to execute. Can anybody help me with this? I guess it has sth to do with how large a string can store. But it shouldn't matter too much because the memory in a decent PC now can store a 350KB.
Appreciate any help
BIG NOTE: Assume that this file has only alphabetical characters only (i.e. [A-Z] only)