• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to insert variable into a string

guisalum

New Member
Joined
Dec 22, 2009
Messages
22
Reaction score
0
I know this is a dumb question. For example I have the variable

Code:
local var = "world"

and I want to create another variable but I want t oinsert this 'var'.

For example

Code:
local anotherVar = "Hello " var "."

If you know Php it'd be like this

Code:
$var = "world";
$anotherVar = "Hello " . $var . ".";

How do I do this?

thanks
 
I ot it (just use double dots) hehe

Can I use variable to return value of tables?

for instance:

I have the table

Code:
local table = {"hello", welcome = {item1 = "hello", item2 = "world"}}

But I wnat to call the table not using table.welcome.item1

I want to use like

Code:
local table = {"hello", welcome = {item1 = "hello", item2 = "world"}}
local var = "welcome"

table.var.item1

Is it possible?
table.welcome.
 
Back
Top