[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why is string.find() giving wrong output?
- From: HyperHacker <hyperhacker@...>
- Date: Mon, 30 Jan 2012 07:19:10 -0700
On Mon, Jan 30, 2012 at 07:17, rahul sharma <rahulatgslab@gmail.com> wrote:
> Hi,
>
> I have lua-5.1.4 installed. I fired the following commands:-
>
>> a="0x12,0x23,0x1e"
>> string.find(a,',',1)
>> print(string.find(a,',',1))
> 5 5
>> b="0x12.0x23.0x1e"
>
>> print(string.find(a,'.',1))
> 1 1
>>
>
> Why is it giving such a wrong answer??
Check out string.find and Patterns in the manual. A period matches any
character, unless you set the "plain" option.
--
Sent from my toaster.