65.9K
CodeProject is changing. Read more.
Home

Counting lines in a string

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Jan 11, 2012

CPOL
viewsIcon

8343

How about using the extension method: return s.Count(c => (c == '\n'));

How about using the extension method:
 return s.Count(c => (c == '\n'));