65.9K
CodeProject is changing. Read more.
Home

Counting lines in a string

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Jan 17, 2012

CPOL
viewsIcon

7240

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.