TorqueScript Reference
|
Functions | |
String | getSubStr (sourceString, start, count) |
String | ltrim (sourceString) |
String | rtrim (sourceString) |
String | strchr (sourceString, char) |
Integer | strcmp (string1, string2) |
Integer | stricmp (string1, string2) |
String | stripChars (sourceString, chars) |
String | stripColorCodes (stringtoStrip) |
String | stripTrailingSpaces (string) |
Integer | strlen (string) |
String | strlwr (sourceString) |
Integer | strpos (sourceString, searchString, [offset]?) |
String | strrchr (sourceString, char) |
String | strreplace (sourceString, from, to) |
Integer | strstr (sourceString, searchString) |
String | strupr (sourceString) |
String | trim (sourceString) |
String getSubStr | ( | sourceString | , |
start | , | ||
count | |||
) |
Use the getSubStr function to get a sub-string of sourceString, starting at character index start and ending at character index start + count, or the end-of-string, which ever comes first. If start + count is greater than the length of sourceString, the extraction will return a string shorter than count.
sourceString | The string from which to extract a sub-string. |
start | The character index at which the extraction starts. |
count | The length of the sub-string to extract. |
String ltrim | ( | sourceString | ) |
Use the ltrim function to strip the leading white space from sourceString. White space is any character in this set: spaces, TABs, and NULL strings.
sourceString | The string to be trimmed. |
String rtrim | ( | sourceString | ) |
Use the rtrim function to strip the trailing white space from sourceString. White space is any character in this set: spaces, TABs, and NULL strings.
sourceString | The string to be trimmed. |
String strchr | ( | sourceString | , |
char | |||
) |
Use the strchr function to extract a sub-string of sourceString, where the sub-string is equal to the first occurence of char in sourceString followed by the remainder of sourceString.
sourceString | The string from which to extract a sub-string. |
char | The character to search for in sourceString. |
Integer strcmp | ( | string1 | , |
string2 | |||
) |
Use the strcmp function to do a lexicographic case sensitive string comparison between string1 and string2.
string1 | String to be compared to string2. |
string2 | String to be compared to string1. |
Integer stricmp | ( | string1 | , |
string2 | |||
) |
Use the stricmp function to do a lexicographic case in-sensitive string comparison between string1 and string2.
string1 | String to be compared to string2. |
string2 | String to be compared to string1. |
String stripChars | ( | sourceString | , |
chars | |||
) |
Use the stripChars function to remove chars from sourceString.
sourceString | The string to be modified. |
chars | The character or characters to search for and remove. |
String stripColorCodes | ( | stringtoStrip | ) |
remove TorqueML color codes from the string.
stringtoString | The string from which to remove TorqueML color codes |
String stripTrailingSpaces | ( | string | ) |
Removes all spaces after the final
string | from which to remove trailing spaces |
Integer strlen | ( | string | ) |
Use the strlen function to determine how many characters there are in string.
string | The string to count characters for. |
String strlwr | ( | sourceString | ) |
Use the strlwr function to convert all alpha characters in sourceString to lower-case equivalents.
sourceString | The string to be modified. |
Integer strpos | ( | sourceString | , |
searchString | , | ||
[offset] ? | |||
) |
Use the strPos function to locate the first instance of searchString in sourceString, starting at character 0, or at an optional offset.
sourceString | The string in which to search for searchString. |
searchString | The string for which to search for in sourceString. |
offset | An optional non-negative integer value representing the character offset within sourceString at which to begin the search. |
String strrchr | ( | sourceString | , |
char | |||
) |
strrchr searches the sourceString for the last occurance of the given char
sourceString | The string to search |
String strreplace | ( | sourceString | , |
from | , | ||
to | |||
) |
Use the strreplace function to replace every instance of from in sourceString with to. This function is case-sensitive and only does exact matching
sourceString | The string to do replacement operations on. |
from | The old value to be replaced. |
to | The new value to replace old values with. |
Integer strstr | ( | sourceString | , |
searchString | |||
) |
Use the strstr function to locate the first instance of searchString in sourceString.
sourceString | The string in which to search for searchString. |
searchString | The string for which to search for in sourceString. |
String strupr | ( | sourceString | ) |
Use the strupr function to convert all alpha characters in sourceString to upper-case equivalents.
sourceString | The string to be modified. |
String trim | ( | sourceString | ) |
Use the trim function to strip the leading and trailing white space from sourceString. White space is any character in this set: spaces, TABs, and NULL strings.
sourceString | The string to be trimmed. |