lua-users home
lua-l archive

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


> Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>> =("12345"):sub(1,0)
   The reference manual says (pg. 74 /
http://www.lua.org/manual/5.1/manual.html#5.4):
"Indices are allowed to be negative and are interpreted as indexing
backwards, from the end of the string. Thus, the last character is at
position -1, and so on." To me, that means sub(1, 0) should return the
string between the first character and the last character, i.e., the
empty string.

Scott