Click here to Skip to main content
13,000,569 members (46,073 online)
Click here to Skip to main content

Counting lines in a string

, 10 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
Web02 | 2.8.170624.1 | Last Updated 10 Jan 2012
Article Copyright 2012 by George Swan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid