[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: string:sub
- From: David Burgess <dabsoft@...>
- Date: Sat, 06 Mar 2010 11:29:25 +1100
It seems to me that negative values of string.sub() are inconsistent
with not only the first parameter but also with string.find().
I am boldly suggesting that the second parameter with negative indices
behave the same as the first. I guess this implies that the value 0 for
the second parameter would return the length of the string.
Maybe I have used too many similar functions in other languages but -1
meaning the last character seems intuitive to me.
Anyone else of a like view?