lua-users home
lua-l archive

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


On Wed, Aug 19, 2009 at 11:41 PM, Michael
Newberry<mnewberry@mirametrics.com> wrote:
> Yes, "subtle". But remember words can be important.
>
> Thanks for your help.
>
> Michael

In case it comes up for you, table.concat() is another library
function that is much more efficient than concatenating large numbers
of strings into one big string using the .. operator. And the manual
says this about it:

"Given an array where all elements are strings or numbers, returns
table[i]..sep..table[i+1] ··· sep..table[j]. (...)"

While it *does* return the equivalent of that, it is more efficient in
how it goes about it.

(I'm not saying that you should consider table.concat as an option in
repeating a single byte, it just seems relevant to a broader
understanding of these things.)

-Duncan