lua-users home
lua-l archive

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


Maybe you have identified the issue:

Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
> =("12345"):sub(1,0)
12345

If you get nothing then I guess thats where the confusion comes
from. I will check into this.

Thanks.

On 7/3/2010 12:06 AM, Erik Lindroos wrote:
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.