[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.find
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 15 Oct 2010 17:28:25 -0300
> I want to use string.find and it returns two numbers, but I do not know how
> to use this return.
> I tried :
> a="cou cou cou";
> b=string.find(a,"(%s+)");
Try the code below.
b,e=string.find(a,"(%s+)")
The b will contain 4 and e will contain 6.
b is the start of the first run of spaces in a, e is the end.
"cou cou cou";
123456789
String positions in Lua start at 1.