StendhalScripting/Lua: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>AntumDeluge →Misc: typecasting |
imported>AntumDeluge →Data Types: string concatenation |
||
| Line 50: | Line 50: | ||
-- table variable |
-- table variable |
||
local var4 = {} |
local var4 = {} |
||
</pre> |
|||
=== Strings === |
|||
==== String Concatenation ==== |
|||
String concatenation is simple, much like Java uses a plus operator (<code>+</code>) to join strings, Lua uses two periods (<code>..</code>). |
|||
Example: |
|||
<pre> |
|||
-- create a string variable |
|||
local var = "Hello" |
|||
-- append another string |
|||
var = var .. " world!" |
|||
print(var) -- prints "Hello world!" |
|||
</pre> |
</pre> |
||