You know how you can add string to a print command? print(object," is not here")
How could you do that when naming an object instead? object.Name = object, " test"
I have no idea how to go about this, any help would be appreciated.
Combining Strings
To combine strings, concatenate them with two dots (…). Concatenating strings doesn’t insert a space between them, so you’ll need to include space(s) at the end/beginning of a preceding/subsequent string, or concatenate a space between the two strings.
local hello = "Hello"
local helloWithSpace = "Hello "
local world = "world!"
local string1 = hello .. world
local string2 = helloWithSpace .. world
local string3 = hello .. " " .. world
print(string1) --> Hello
print(string2) --> world!
print(string3) --> Hello world!
Note that the print() command takes multiple arguments and combines them with spaces, so you can use , instead of … to yield spaces in print() outputs.
Thanks, I did not see this at first
You can also use string interpolations, they finally got added:
local str = `text {variable} text`
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.