lua-users home
lua-l archive

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


>> - You always use string.len() for retrieving the length of the string.
>> Why not use the # operator ?
>
> true, is there an advantage ( apart from looking nicer) ? i remember
> that there was some pitfall in using # , but i don't remember right now,
> ill give it a go. ( the thing i remember might be related to unicode
> strings )

I am not aware of any difference in behavior. I have never used the
string.len form, which look to me like an old Lua 5.0 function.
But I checked in the manual, and was surprised to note that it is not
marked as deprecated, not even in Lua 5.2.
To Roberto: is this function still maintained for compatibility, or
for another reason ?