lua-users home
lua-l archive

string like arrays

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


Hi,
there is some how, in Lua, to access string bytes like an array; something like what we can use in C or Pascal?
examples:
s = 'Lua race'
print( a[5] ) --> prints "r"
It would be very desirable to be able to write too, like:
s[5] = 'f'
print( s ) --> prints "Lua face"
Thanks,
--
Marco Antonio Abreu
falecomigo@marcoabreu.eti.br
http://www.marcoabreu.eti.br

AltStyle によって変換されたページ (->オリジナル) /