Interface StringUtil
access this type via: data.StringUtil (provides, requires or uses)
Inspect and transform strings.
Constants
int NOT_FOUND
Functions
char[] subString(char string[], int start, int length)
char[] ltrim(char string[])
char[] rtrim(char string[])
char[] trim(char string[])
char[] uppercase(char string[])
char[] lowercase(char string[])
bool iequal(char a[], char b[])
int find(char in[], char searchTerm[], optional int startIndex)
int ifind(char in[], char searchTerm[], optional int startIndex)
int rfind(char in[], char searchTerm[], optional int startIndex)
int irfind(char in[], char searchTerm[], optional int startIndex)
String[] explode(char str[], char tokens[])
char[] implode(String parts[], char glue[])
bool isNumeric(char str[])
bool startsWith(char str[], char with[])
bool endsWith(char str[], char with[])
String[] lsplit(char str[], char searchStr[])
String[] rsplit(char str[], char searchStr[])
Constants
NOT_FOUND This is returned by search functions when the search term is not found in the string.
char[] subString(char string[], int start, int length)
Return a sub-string of the given string.
string The string from which to return a sub-string.
start The index into string from which to begin retrieving a sub-string.
length The length of the sub-string to return.
char[] ltrim(char string[])
Return the given string with all white space removed from the start.
char[] rtrim(char string[])
Return the given string with all white space removed from the end.
char[] trim(char string[])
Return the given string with all white space removed from the start and end.
char[] uppercase(char string[])
Return the given string with all alphabetical characters converted to upper case.
char[] lowercase(char string[])
Return the given string with all alphabetical characters converted to lower case.
bool iequal(char a[], char b[])
Compare two strings, ignoring their case.
int find(char in[], char searchTerm[], optional int startIndex)
Find searchTerm within the string 'in'.
returns: The index of the string being searched for, or NOT_FOUND if the string does not exist.
int ifind(char in[], char searchTerm[], optional int startIndex)
Find searchTerm within the string 'in', ignoring case differences.
returns: The index of the string being searched for, or NOT_FOUND if the string does not exist.
int rfind(char in[], char searchTerm[], optional int startIndex)
Find searchTerm within the string 'in', starting from the end of the other string.
returns: The index of the string being searched for, or NOT_FOUND if the string does not exist.
int irfind(char in[], char searchTerm[], optional int startIndex)
Find searchTerm within the string 'in', starting from the end of the other string, ignoring case differences.
returns: The index of the string being searched for, or NOT_FOUND if the string does not exist.
String[] explode(char str[], char tokens[])
Tokenise a string using the given list of tokens.
returns: An array of tokens.
char[] implode(String parts[], char glue[])
Glue an array of strings together into a single string, using a glue string between each string in the original array. Null array cells are ignored, such that a single instance of the glue string is added between each non-null pair of cells.
returns: A string.
bool isNumeric(char str[])
Check if a string is comprised only of numbers.
returns: True if the string is comprised only of numerical characters, false otherwise.
bool startsWith(char str[], char with[])
Check if a string starts with another string.
returns: True if the string is comprised only of numerical characters, false otherwise.
bool endsWith(char str[], char with[])
Check if a string ends with another string.
returns: True if the string is comprised only of numerical characters, false otherwise.
String[] lsplit(char str[], char searchStr[])
Split a string into two halves at the first occurance of a given search string.
returns: The left and right parts of the string, both of which exclude the search string, or null if the search term wasn't found.
String[] rsplit(char str[], char searchStr[])
Split a string into two halves at the last occurance of a given search string.
returns: The left and right parts of the string, both of which exclude the search string, or null if the search term wasn't found.