Answered by
8 years ago Edited 6 years ago
You use the string concatenation operator ..
.
It basically serves to merge two string values together into one. E.g:
10 | print ( "I am " .. age .. " years old." ) |
Note that other Lua types will have to be transformed into strings using the "tostring()" function before being concatenated:
07 | print ( "boolean: " .. true ) |
13 | print ( "function: " .. function () end ) |
16 | print ( "coroutine: " .. coroutine.create( function () end )) |
19 | print ( "Vector3: " .. Vector 3. new()) |
25 | print ( "nil: " .. tostring ( nil )) |
28 | print ( "boolean: " .. tostring ( true )) |
31 | print ( "table: " .. tostring ( { } )) |
34 | print ( "function: " .. tostring ( function () end )) |
37 | print ( "coroutine: " .. tostring (coroutine.create( function () end ))) |
40 | print ( "Vector3: " .. tostring (Vector 3. new())) |
Hope this helps. If it did, please upvote my answer and mark it as accepted.
If you need anything else, feel free to send me a message.
Locked by User#19524
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?