Click here to Skip to main content
13,298,731 members (41,351 online)
Click here to Skip to main content

Counting lines in a string

, 11 Jan 2012
How about using the extension method: return s.Count(c => (c == '\n'));
This is an old version of the currently published tip/trick.

This article is still being written and is not currently available for general viewing.

Please go to the .NET Framework Table of Contents to view the list of available articles in this section.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 11 Jan 2012
Article Copyright 2012 by George Swan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid