3 ms·
Of course, languages like Java have StringBuffer objects. In Lua, if you are generating a string, and you know that it will need a lot of concatenations, you ca
by russellsprouts 13y ago
Of course, languages like Java have StringBuffer objects. In Lua, if you are generating a string, and you know that it will need a lot of concatenations, you can use something like this:
local string_buffer = {}
while condition() do
table.insert(string_buffer, getString())
end
local string = table.concat(string_buffer)