lua-users home
lua-l archive

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


On Sat, Mar 6, 2010 at 1:59 PM, David Burgess <dabsoft@gmail.com> wrote:
The inconsistency is what the value 0 does on parameter 2,
seemingly the same as -1. I would have expected -1 on parameter 2
to mean 1 less than zero, i.e. -1 from the end.

What do you mean with seemingly the same? Clearly it's not the same. sub(1, 0) gives you an empty string, sub(1, -1) gives you the whole string, just as you pasted.