counting strings on array
Posted: Mon Oct 28, 2013 1:20 am
If I have a string array (with long textual strings; thus - ruby), I'd like to count - how many lines are not empty. Like this:
---------
text
text
text
text
---------
In general - there are 8 lines on that array, but not empty - only four. How to detect them? I guess it should be some simple formula for empty lines removal, and then measurement via int primitive connected to array out. Or...?
---------
text
text
text
text
---------
In general - there are 8 lines on that array, but not empty - only four. How to detect them? I guess it should be some simple formula for empty lines removal, and then measurement via int primitive connected to array out. Or...?