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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.