C#.net Read From Text File
There's a good topic about this in Stack Overflow question. It says: ReadAllLines loads all of the lines into memory and returns a string[]. All well and good if the file is small.
It is used where a c pronounced /s/ occurs before a, o or u (due to etymology or inflection). Examples: (inflection). View Citigroup Inc. C investment & stock information. Get the latest Citigroup Inc. C detailed stock quotes, stock data, Real-Time ECN, charts, stats and more.
How can I Install the Oracle 10g (10.2.0.2) patch. Please any one help me., Oracle 10g Patch Installation Procedure., Installation BASIS Forum| STechies. Home Up Oracle 10G Installation Oracle 9i Installation Oracle 7.3.x and 8.0.x Installations Oracle Patch Installation. Oracle Patch Installation Procedure.
If the file is larger than will fit in memory, you'll run out of memory. ReadLines, on the other hand, uses yield return to return one line at a time. With it, you can read any size file. It doesn't load the whole file into memory. Say you wanted to find the first line that contains the word 'foo', and then exit. Using ReadAllLines, you'd have to read the entire file into memory, even if 'foo' occurs on the first line.
With ReadLines, you only read one line. Which one would be faster?