lua-users home
lua-l archive

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


On Tue, 2010-12-21 at 10:20 +0200, Dirk Laurie wrote:
> 
> One could, though, make s[k] mean "a one-byte string consisting of
> the 
> k-th byte of s", i.e.
>     s[k] == string.char(string.byte(s,k,k))
> Then it is obvious that "s[3]='c'" is nonsense, since
>     string.char(string.byte(s,3,3)) = 'c'
> is nonsense.

Why not just string.sub(s,3,3)? :)