lua-users home
lua-l archive

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


On Dec 13, 2010, at 9:44 PM, Dirk Laurie wrote:

> In the light of that statement, one can't be blamed for expecting
> that s[i] means the i-th character of a string.  At present, s[i]
> is nil, even if i is in the range 1 to #s -- another gotcha.

Meh...

getmetatable( '' )[ '__index' ] = function( aTable, anIndex ) return string.char( string.byte( aTable, anIndex ) ) end