[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: How to count the number of lines in a string?
- From: Olivier Galibert <galibert@...>
- Date: Thu, 31 Jul 2008 12:51:22 +0200
Simple unix-ish string with EOL as '\n' (0x0a), what is the most
efficient way of counting the number of lines? I can think of a bunch
of methods (looping on byte(), looping on find(plain) for instance),
but it's far from clear which one would be the most efficient. Any
idea which one would be?