lua-users home
lua-l archive

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


So you should write in LuaRT :
for i = 1, str:len() do
local c = str:sub(i, i)
....
end

IMO, both #str and str:sub() should use the same unit of measurement:
either byte or unicode codepoint.
Otherwise I don't understand what "compatibility with Lua" you're talking about.
Most old Lua scripts working with strings will be broken.