[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: string:sub
- From: Erik Lindroos <gliptic@...>
- Date: Sat, 6 Mar 2010 14:06:41 +0100
On Sat, Mar 6, 2010 at 1:59 PM, David Burgess <firstname.lastname@example.org>
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.