[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to count the number of lines in a string?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 31 Jul 2008 08:35:46 -0300
> what is the most efficient way of counting the number of lines?
Try this one:
local n=0
for i in s:gmatch("\n") do n=n+1 end
print(n)