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 search[])
int ifind(char in[], char search[])
int rfind(char in[], char search[])
int irfind(char in[], char search[])
String[] explode(char str[], char tokens[])
char[] implode(String parts[], char glue[])
bool isNumeric(char str[])
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 search[])
Search for one string in another string.
returns: The index of the string being searched for, or NOT_FOUND if the string does not exist.
int ifind(char in[], char search[])
Search for one string in another string, 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 search[])
Search for one string in another string, 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 search[])
Search for one string in another string, 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.