String concatenation

how to concatenate variables and strings without doing a…“hi” ?

i think there is another way but i can’t remember

No, this is the way unless you are using tables then there is a concat() function on tables.

You can use string.format

local concat = string.format("Hello %s", "World!")
print(concat) --> prints Hello World!

Or the newly added string interpolation

local hello = "Hello"
local concat = `{hello} World!`
print(concat) --> prints Hello World!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.