|
| 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) |
| |
General string manipulation functions.
| 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.
- Parameters
-
| 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. |
- Returns
- Returns a string made up of the character at start in sourceString and ending at the end of the original sourceString, or start + count, whichever comes first.
- See Also
- strchr
| 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.
- Parameters
-
| sourceString | The string to be trimmed. |
- Returns
- Returns sourceString with all the leading white spaces removed.
- See Also
- stripChars, stripMLControlChars, stripTrailingSpaces, rtrim, trim
| 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.
- Parameters
-
| sourceString | The string to be trimmed. |
- Returns
- Returns sourceString with all the trailing white spaces removed.
- See Also
- stripChars, stripMLControlChars, stripTrailingSpaces, ltrim, trim
| 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.
- Parameters
-
| sourceString | The string from which to extract a sub-string. |
| char | The character to search for in sourceString. |
- Returns
- Returns a string composed of first instance of char in sourceString, and all of the characters after it. If char is not found, a NULL string is returned.
- See Also
- getSubStr
| int strcmp |
( |
string1 |
, |
|
|
string2 |
|
|
) |
| |
Use the strcmp function to do a lexicographic case sensitive string comparison between string1 and string2.
- Parameters
-
| string1 | String to be compared to string2. |
| string2 | String to be compared to string1. |
- Returns
- Returns a numeric value: <-1 (string1 is less than string2, including case), 0 (string1 is equal to string2, including case), 1 (string1 is greater than string2, including case)>.
- See Also
- see stricmp, strstr
| int stricmp |
( |
string1 |
, |
|
|
string2 |
|
|
) |
| |
Use the stricmp function to do a lexicographic case in-sensitive string comparison between string1 and string2.
- Parameters
-
| string1 | String to be compared to string2. |
| string2 | String to be compared to string1. |
- Returns
- Returns a numeric value: <-1 (string1 is less than string2, ignoring case), 0 (string1 is equal to string2, ignoring case), 1 (string1 is greater than string2, ignoring case)>.
- See Also
- see strcmp, strstr
| string stripChars |
( |
sourceString |
, |
|
|
chars |
|
|
) |
| |
Use the stripChars function to remove chars from sourceString.
- Parameters
-
| sourceString | The string to be modified. |
| chars | The character or characters to search for and remove. |
- Returns
- Returns a copy of sourceString, from which all instances of chars have been removed. This may be the original sourceString, if chars was not found.
- See Also
- stripMLControlChars, stripTrailingSpaces
| string stripColorCodes |
( |
stringtoStrip |
| ) |
|
- remove TorqueML color codes from the string.
- Parameters
-
| stringtoString | The string from which to remove TorqueML color codes |
- Returns
- A string consisting of the original string minus color codes
| string stripTrailingSpaces |
( |
string |
| ) |
|
Removes all spaces after the final
- Parameters
-
| string | from which to remove trailing spaces |
- Returns
- the source string minus trailing spaces
Use the strlen function to determine how many characters there are in string.
- Parameters
-
| string | The string to count characters for. |
- Returns
- Returns the number of characters in string, or 0 if string is invalid or a NULL string
| string strlwr |
( |
sourceString |
| ) |
|
Use the strlwr function to convert all alpha characters in sourceString to lower-case equivalents.
- Parameters
-
| sourceString | The string to be modified. |
- Returns
- Returns a copy of sourceString in which all upper-case characters have been converted to lower-case letters.
- See Also
- strupr
| 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.
- Parameters
-
| 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. |
- Returns
- Returns a numeric character index representing the postion in sourceString at which searchString was found, or -1 to indicate that no instance of searchString was found.
- See Also
- strstr
| string strrchr |
( |
sourceString |
, |
|
|
char |
|
|
) |
| |
strrchr searches the sourceString for the last occurance of the giuven char
- Parameters
-
| sourceString | The string to search |
- Returns
- Either a string consisting of the given string from the last occurance of the given char on or an empty string if not found
| 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
- Parameters
-
| sourceString | The string to do replacement operations on. |
| from | The old value to be replaced. |
| to | The new value to replace old values with. |
- Returns
- Returns a new version of sourceString in which every instance of the value in from was replaced with the value in to.
| int strstr |
( |
sourceString |
, |
|
|
searchString |
|
|
) |
| |
Use the strstr function to locate the first instance of searchString in sourceString.
- Parameters
-
| sourceString | The string in which to search for searchString. |
| searchString | The string for which to search for in sourceString. |
- Returns
- Returns a numeric character index representing the position in sourceString at which searchString was found, or -1 to indicate that no instance of searchString was found.
- See Also
- strpos
| string strupr |
( |
sourceString |
| ) |
|
Use the strupr function to convert all alpha characters in sourceString to upper-case equivalents.
- Parameters
-
| sourceString | The string to be modified. |
- Returns
- Returns a copy of sourceString in which all lower-case characters have been converted to upper-case letters.
- See Also
- strlwr
| 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.
- Parameters
-
| sourceString | The string to be trimmed. |
- Returns
- Returns sourceString with all the leading and trailing white spaces removed.
- See Also
- stripChars, stripMLControlChars, stripTrailingSpaces, ltrim, rtrim