There really isn't a nice way! :laugh:
This:
Counting Lines in a String[
^] shows a number of ways to count lines, and it wouldn't be difficult for you to modify any of those to count blank lines.
But there is no simple solution: "lines" don't really exist in text files, they are just a convention of the software which processes them and uses the "line separator character" to distinguish between them!