[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string[], doesn't exist?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 21 Jun 2006 14:54:51 -0300
> > s="lua"
> > print(s[2])
> --> nil
>
> What does it do?
It tries to get field 2 from string (the table). Since there's no value
at string[2], it returns nil.
Try
string[2]="hello"
print(("xxx")[2])
--lhf
- References:
- Bitwsie operators in Lua, mike krimerman
- Re: Bitwsie operators in Lua, Gavin Wraith
- Re: Bitwsie operators in Lua, Sam Roberts
- Re: Bitwsie operators in Lua, Andy Stark
- Re: Bitwsie operators in Lua, Doug Rogers
- Re: Bitwsie operators in Lua, Andy Stark
- Re: Bitwsie operators in Lua, Roberto Ierusalimschy
- string[], doesn't exist?, Sam Roberts
- Re: string[], doesn't exist?, Luiz Henrique de Figueiredo
- Re: string[], doesn't exist?, Sam Roberts