C# Very Large String Manipulation (Out of Memory Exception)

后端 未结 5 1031
别跟我提以往
别跟我提以往 2021-01-17 10:32

I have a need to read in a 1gb raw text file from disk to ram to do some string manipulation in C#.

string contents = File.ReadAllText(path)
<
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-17 11:13

    Try with System.IO.StreamReader

    Any difference between File.ReadAllText() and using a StreamReader to read file contents?

提交回复
热议问题