How do you search a large text file for a string without going line by line in C#?

后端 未结 14 1810
灰色年华
灰色年华 2020-12-15 08:23

I have a large text file that I need to search for a specific string. Is there a fast way to do this without reading line by line?

This method is extremely slow beca

14条回答
  •  感情败类
    2020-12-15 09:13

    Given the size of the files would you really want to read them entirely into memory beforehand? Line by line is likely to be the best approach here.

提交回复
热议问题