lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 12/12/14 11:11 AM, Dirk Laurie wrote:
2014-12-12 14:59 GMT+02:00 Thiago L. <fakedme@gmail.com>:
Is there any way I can do

for from,to in string.findpairs("my string", ".") do
   print(from, to)
end
Do you mean this?
_=string.gsub("The quick brown fox jumps over the lazy dog","()%S+()",print)
1    4
5    10
11    16
17    20
21    26
27    31
32    35
36    40
41    44

Can I do that with a for loop?

--
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.