Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

Counting lines in a string

0.00/5 (No votes)
17 Jan 2012CPOL 7.2K  
I had to do something like this in XSLT. If the string is not too long (for some definition of too long), you can replace all newlines with and then take the difference in the two string lengths.

I had to do something like this in XSLT. If the string is not too long (for some definition of "too long"), you can replace all newlines with "" and then take the difference in the two string lengths.

License

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