Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

"Inject" value into a string?

I know you can do

local value = "iLord"
print("my name is "..value.." and I love pizza")

which would print: my name is iLord and I love pizza

But in JavaScript you can do

console.log(`my name is ${name} and I love pizza`)

(console.log is the same as print)

Which would print the same thing, is there a way to do this in lua?

1 answer

✓ Accepted answer

There's nothing embeded like that to perform string Interpolation.

print( string.format("my name is %s and I love pizza", value) )

This discussion is preserved as it was. New answers, comments, and votes are closed.