[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: string.sub for suffix not usable with varying length (including zero)
- From: Richter, Jörg <Joerg.Richter@...>
- Date: Mon, 11 Feb 2013 10:39:38 +0000
> 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 "".