A function is a set of code, that take a finite number of input and optionally returns a value. None of these functions are case-sensitive.
Functions that operate on string expression are classified as string functions, they include functions for finding the length of a given text, remove certain words from a text etc.
In all the given functions, the original string is not changed by the functions, whereas only the return value is affected by these functions.
| Operator | Functionality** | Concatenate two strings |
|---|---|---|
| + | <string1> + <string2> | Concatenate two strings |
| remove(<string>) | <string>.remove(<substring>) |
Eliminate the substring from the given string.
|
| removeFirstOccurence() |
<string>.removeFirstOccurence(<substring>) |
Eliminate the first occurence of the substring from the given string.
|
| removeLastOccurence() | <string>.removeLastOccurence(<substring>) |
Eliminate the last occurence of the substring from the given string.
|
| getSuffix() |
<string>.getSuffix(<substring>) |
Get the string after the specified substring.
|
| getPrefix() | <string>.getPrefix(<substring>) |
Get the string before the specified substring.
|
| toUpperCase() |
<string>.toUpperCase() |
Convert the string to uppercase.
|
| toLowerCase() | <string>.toLowerCase() |
Convert the string to lowercase.
|
| getAlphaNumeric() |
<string>.getAlphaNumeric() |
Retain only the alphanumeric present in the specified string.
|
| getAlpha() | <string>.getAlpha() |
Retain only the alphabets present in the specified string.
|
| removeAllAlphaNumeric() |
<string>.removeAllAlphaNumeric() |
Remove all the alphanumeric present in the specified string.
|
| removeAllAlpha() | <string>.removeAllAlpha() |
Remove all the alphabets present in the specified string.
|
| length() |
<string>.length() |
Get the length of the given string.
|
| getOccurenceCount() | <string>.getOccurenceCount(<substring>) |
Gets the number of times a substring is present in the given string.
|
| indexOf() |
<string>.indexOf(<substring>) |
Gets the index of the first occurence of the substring in the given string.
|
| lastIndexOf() | <string>.lastIndexOf(<substring>) |
Gets the index of the last occurence of the substring in the given string.
|
** <string>,<string1>,<string2>, <substring> are all <string expression>
These functions operate on two string expression and return a boolean expression.
| Operator | Usage | Returns true when |
|---|---|---|
| == | <string1> == <string2> |
two string expressions are equal |
| contains() | <string1>.contains(<string2>) | string2 is a substring of string1 |
| startsWith() |
<string1>.startsWith(<string2>) |
string1 starts with string2 |
| endsWith() | <string1>.endsWith(<string2>) | string1 ends with string2 |
| Operator | Usage | Returns |
|---|---|---|
| getDay() |
where, <date> is a form field of type "date"
|
returns a number in the range (1 - 31), representing the number of the day of the month on which the date occurs. |
| getMonth() |
<date>.getMonth()
where, <date> is a form field of type "date"
|
returns a number in the range (1 -12), representing the number of the month of the year, on which the date occurs. |
| getYear() |
<date>.getYear()
where, <date> is a form field of type "date"
|
returns a number representing the year of the date. |
| getWeekOfYear() |
<date>.getWeekOfYear()
where, <date> is a form field of type "date"
|
returns a number in the range (1 - 52), representing the number of the week in the year.
For example, "16/1/2007" returns 3. |
| getDayOfWeek() |
<date>.getDayOfWeek()
where, <date> is a form field of type "date"
|
returns a number in the range (1 - 7), representing the number of the day of the week, that date falls.
The number "1" represents Sunday, "2" represents Monday and so on. |