Difference between revisions of "String keyword"
(→Persistence) |
m (Updating links) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | The '''string''' type represents a sequence of between zero and approximately two billion characters. The default value a string containing zero characters. | + | The '''string''' type represents a sequence of between zero and approximately two billion characters. The default value is a string containing zero characters. |
== Literals == | == Literals == | ||
− | + | A string [[Scripting terminology#literal|literal]] consists of zero or more characters enclosed in double quotes. | |
− | + | ||
− | A string literal consists of zero or more characters enclosed in double quotes. | + | |
== Conversion == | == Conversion == | ||
− | There is no | + | === Explicit === |
+ | |||
+ | The following functions can be used to convert another data type to a string: | ||
+ | |||
+ | * [[FloatToString]] | ||
+ | * [[IntToChar]] | ||
+ | * [[IntToString]] | ||
+ | * [[IntToHexString]] | ||
+ | * [[ObjectToString]] | ||
+ | * [[ResourceToString]] | ||
+ | * [[ToString]] | ||
+ | * [[VectorToString]] | ||
+ | |||
+ | The following functions can be used to convert a string to another data type: | ||
+ | |||
+ | * [[CharToInt]] | ||
+ | * [[HexStringToInt]] | ||
+ | * [[StringToFloat]] | ||
+ | * [[StringToInt]] | ||
+ | * [[StringToVector]] | ||
+ | |||
+ | === Implicit === | ||
+ | |||
+ | There is no implicit conversion to a string. | ||
== Persistence == | == Persistence == | ||
Line 20: | Line 41: | ||
* [[SetEventString]] | * [[SetEventString]] | ||
− | The following functions allow a string which | + | The following functions allow a string which exists outside of the scope of the current script to be used in the current script by retrieving it from an object, effect or event: |
* [[GetLocalString]] | * [[GetLocalString]] | ||
Line 67: | Line 88: | ||
[[PrintString]] | [[PrintString]] | ||
− | [[Category: | + | [[Category:Keywords]] |
Latest revision as of 12:23, 15 August 2011
The string type represents a sequence of between zero and approximately two billion characters. The default value is a string containing zero characters.
Literals
A string literal consists of zero or more characters enclosed in double quotes.
Conversion
Explicit
The following functions can be used to convert another data type to a string:
- FloatToString
- IntToChar
- IntToString
- IntToHexString
- ObjectToString
- ResourceToString
- ToString
- VectorToString
The following functions can be used to convert a string to another data type:
Implicit
There is no implicit conversion to a string.
Persistence
The following functions allow a string to exist outside of the scope of the current script by storing it on an object, effect or event:
The following functions allow a string which exists outside of the scope of the current script to be used in the current script by retrieving it from an object, effect or event:
Special
Concatenation
Two or more strings can be concatenated together using the concatenation operator "+".
Escape sequences
Escape sequences are used to insert special characters into a string literal. An escape sequence begins with a backslash character "\" followed by another string literal character.
Sequence | Description |
---|---|
\\ | The "\" character |
\n | A new line (a carriage return and line feed) |