lua-users home
lua-l archive

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


Thanks. Yes, I saw that discussion in the blue PIL.

Michael

----- Original Message ----- From: "Duncan Cross" <duncan.cross@gmail.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Wednesday, August 19, 2009 3:53 PM
Subject: Re: Simple way to create a big string of blanks?


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