Click here to Skip to main content
15,889,034 members
Articles / Programming Languages / C#

Counting lines in a string

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
11 Jan 2012CPOL 8K  
How about using the extension method: return s.Count(c => (c == '\n'));

Views

Daily Counts

License

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


Written By
Student
Wales Wales
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions