Re: String represents arrays of characters.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: String represents arrays of characters.
- From: Petite Abeille <petite_abeille@...>
- Date: 2010年12月13日 21:57:43 +0100
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