lua-users home
lua-l archive

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

> Lua 5.2 has one more paragraph describing what happens in this case.
> But I think this paragraph was only added for cases like this:
>   string.sub( "abc", -4 )

At least this conjecture is wrong of me:

From the ref-manual:
> If, after the translation of negative indices, i is less than 1, it is corrected to 1.

So this sentence handles only i=0? (Ignoring fractional numbers)

Still thinking that string.sub( str, 0 ) should return "".