__
.string
library table. Which is why if you run this code, you'll see the __index
of the metatable print this out::
syntactic sugar, both are equivalent, but the second is preferred for shorter code. The left hand of the :
will be inserted as the first argument to string.len
, and will result in the equivalent code: string.len(s)
.tostring
function for the table, which instead calls table.concat to concatenate all table values in sequence with a separator of ,
inbetween each value.