Click here to Skip to main content
15,899,124 members
Articles / Programming Languages / C#

Counting lines in a string

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
17 Jan 2012CPOL 9.6K  
Again, going with other people's comments about memory, how about using a Streamreader? (I haven't tested the timings (or code) but from memory..This should be fast (and memory efficient)...at least in my experience.StreamReader sr = new StreamReader("Put file here");Int32 cnt =...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions