|
TorqueScript Reference
|
Functions | |
| string | getSubStr (sourceString, start, count) |
| string | ltrim (sourceString) |
| string | rtrim (sourceString) |
| string | strchr (sourceString, char) |
| int | strcmp (string1, string2) |
| int | stricmp (string1, string2) |
| string | stripChars (sourceString, chars) |
| string | stripColorCodes (stringtoStrip) |
| string | stripTrailingSpaces (string) |
| int | strlen (string) |
| string | strlwr (sourceString) |
| int | strpos (sourceString, searchString,[offset]?) |
| string | strrchr (sourceString, char) |
| string | strreplace (sourceString, from, to) |
| int | 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. |
| int 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. |
| int 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 |
| int 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. |
| int 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 giuven 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. |
| int 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. |
1.8.3.1