User Tools

Site Tools


string

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
string [2017/05/30 11:24] justinstring [2017/06/01 09:00] justin
Line 2: Line 2:
 ---- ----
  
-A **string** is a scripting data type consisting of a string of characters enclosed by double quotes on each end. Strings are typically used to represent a message, for example in the [[Display Message]] function, or when referencing an entity name or property name within a script. [[Placeholder expressions]] can be used within a string as a way to generate dynamic values at game runtime.+A **string** is a scripting data type consisting of a string of characters enclosed by double quotes on each end. Strings are typically used to represent a message, for example in the [[Display Message]] function, or when referencing an entity name or property name within a script. [[placeholder_expression|Placeholder expressions]] can be used within a string as a way to generate dynamic values at game runtime.
  
 ====Example:==== ====Example:====
Line 9: Line 9:
 </code> </code>
  
-The above example shows a string passed to the [[Display Message]] function as an argument.+The above example demonstrates a string passed to the [[Display Message]] function as an argument. 
 + 
 +<WRAP center round info 100%> 
 +**Note:** Any double quotation marks within a string (excluding the quotation marks used to enclose it) must be escaped with a preceding backslash. 
 +</WRAP>
  
 ====Example:==== ====Example:====
 <code lua> <code lua>
-set_entity_property(entity["sign_01"], "message", "This is the sign's message text.")+set_entity_property(entity["sign_01"], "message", "This is the sign'\"message\".")
 </code> </code>
  
string.txt · Last modified: 2021/04/21 20:07 by justin