In Java you can have:
String name = "myNameis";
String myString = name + "myName";
How do have the plus sign (demonstrated above) in Lua
The concatenation operator in Lua is ..
, unlike other languages such as Java
, Python
, etc.
So it would be name .. "myName"
.
If you really want to use +
, you can overload the +
operator to do so.
getmetatable("").__add = function(a, b) return a .. b end
This will NOT work on Roblox.