Concatenation: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Mindraker New |
>Mindraker New |
(No difference)
|
Revision as of 14:27, 17 October 2008
Strings can be joined together using the concatenation operator "..". e.g.,
print("hello" .. " Lua user")
Will result in:
hello Lua user
and
who = "Lua user"
print("hello "..who)
Will result in:
hello Lua user
Numbers can be concatenated to strings. In this case they are coerced into strings and then concatenated.
print("Green bottles: "..10)
Will result in:
Green bottles: 10
and
print(type("Green bottles: "..10))
Will result in:
string