Built-In Functions

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.

String functions

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 Format** Description
     + <string1> + <string2> Concatenate two strings
contains(<string>) <string1>.contains(<string2>)
Returns :boolean
Returns true if string2 is a substring of string1
endsWith(<string>) <string1>.endsWith(<string2>)
Returns :boolean
Returns true if string1 ends with string2
startsWith(<string>)
<string1>.startsWith(<string2>) Returns :boolean
Returns true if string1 starts with string2
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.

 

 

substring(<s.index>, <e.index>)

 

<string1>.substring(<s.index>, <e.index>)

Returns the substring from the specified startindex to the endindex. The startindex and endindex values are base zero specifications (i.e) you reference the positions within the main string starting with zero , the second position in the string is 1, the third is 2 etc..

- startindex value is the position of the first character in the main String to be extracted to the SubString.

- endindex value is the position of character in the main String where you stop extracting to the SubString and NOT the position of the last character in the main string to be extracted to the SubString.

 

trim()

 

<string>.trim() Removes any leading and trailing space from a string

 

equalsIgnoreCase(<string>)

 

<string1>.equalsIgnoreCase<string2> Returns true if <string1> equals <string2>

 

toString()

 

<expression>.toString Converts any type of expression to string

** <string>,<string1>,<string2>, <substring> are all <string expression>

Numeric Functions

Functions that operate on numeric values are classified as numeric functions.

In all the given functions, the original number is not changed by the functions, whereas only the return value is affected by these functions.

Operator Format Description
sin() Format :<numeric>.sin()
Returns :numeric

Returns the trigonometric sine of the given angle
sqrt() Format :<numeric>.sqrt()
Returns :numeric

 

Returns the correctly rounded positive square root of the given value

 

tan()

Format :<numeric>.tan()
Returns :numeric

 

Returns the trigonometric tangent of an angle.

 

toDecimal() Format :<expression>.toDecimal()
Returns :Decimal

 

Returns Decimal from given expression.

 

toLong()

Format :<expression>.toLong()
Returns :numeric

 

Returns Long from given expression.

 

Boolean string functions

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

Date functions

Operator Format Returns
getDay()


<date>.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.

addDay() <date/time>.addMonth(<numeric>)


Returns a Date, after adding the specified number of month(s)

 

addMonth() <date/time>.addMonth(<numeric>)

Returns a Date, after adding the specified number of month(s)
addWeek() <date/time>.addDay(<numeric>)

Returns a Date, after adding the specified number of day(s).
addYear() <date/time>.addYear(<numeric>)

Returns a Date,after adding the specified number of year(s).
subDay() <date/time>.subDay(<numeric>)

Returns a Date, after subtracting the specified number of day(s).
subMonth()

 

<date/time>.subMonth(<numeric>)

 

Returns a Date, after subtracting the specified number of ,month(s).
subWeek() <date/time>.subWeek(<numeric>)

 

Returns a Date, after subtracting the specified number of week(s).

 

subYear() <date/time>.subYear(<numeric>)


Returns a Date, after subtracting the specified number of year(s).

 

toDate() <string>.toDate()
Returns :numeric


Converts string to date Format and returns

 

toTime() <string>.toTime()
Returns :numeric
Converts string to date-time Format and returns

Time functions

Operator Format Returns
addHour()


<date-time>.addHour(<numeric>)

Returns a Date, after adding the specified number of hour(s).

 

addMinutes()

 

<date-time>.addMinutes(<numeric>)

Returns a Date, after adding the specified number of minute(s).

 

addSeconds()

 

<date-time>.addSeconds(<numeric>)

 

Returns a Date, after adding the specified number of second(s).
getHour()

 

<date-time>.getHour()

 

Returns the hour of the day

getMinutes()

 

<date-time>.getMinutes()

Returns the minutes of the hour

getSeconds() <date-time>.getSeconds()


Returns the Seconds of the minute

 

subHour()

 

<date-time>.subHour(<numeric>)


Returns a Date, after subtracting the specified number of hour(s).

 

subMinutes()

 

<date-time>.subMinutes(<numeric>)

Returns a Date, after subtracting the specified number of minute(s).
subSeconds()

 

<date-time>.subSeconds(<numeric>)


Returns a Date, after subtracting the specified number of second(s).

 

List Functions

Operator Format Returns
contains()


<list>.contains(<element>)

Returns :boolean
returns 'true' if the element is present in the list

get()

<list>.get(<index>)

 

Returns :element
returns the element at the specified postion (first element will be at index '0')

indexOf() <list>.indexOf(<element>)

Returns :numeric
returns the position of the given element in list (first element's position is '0')
lastIndexOf() <list>.lastIndexOf(<element>)



Returns the position of the last occurence of the element in the list.

remove() <list>.remove(<index>) remove and return the element at the specified index (first element's index is '0')
sort()

 

<list>.sort(<optional boolean>)

 

Returns :list
returns the list in the sorted order. The optional boolean specifies ascending(true)/descending(false)
size()

 

<list>.size()

 

Returns the number of elements in the list.

isempty()

 

<list>.isempty()

Returns :boolean
returns 'true' if the list is empty (else 'false')

sublist()
<list>.sublist(<start index>,<optional endIndex>)


Returns :list
returns the sublist of the given list starting from the given start index to the specied end index (to the end of the list, if endIndex not given)

 

toList()

 

<string>.toList(<optional separator>)

Returns :list
converts the string to list using the given separator(default separator is ',' (comma))

 

{}

{<optional comma separated elements>}

Returns :list
Create a list with the given elements. Creates empty list if no element is given.
List()

 

List()


Returns :list
Create an empty list.

 

List:String() List:String()
Returns :list
Create an empty string list. This list can hold only string elements
List:Int() List:Int()
Returns :list
Create an empty integer list.This list can hold only integer elements.
List:Date() List:Date()
Returns :list
Create an empty date list.This list can hold only date/datetime elements.
List:Bool() List:Bool() Returns :list
Create an empty boolean list.This list can hold only boolean values.
List:Float() List:Float()


Returns :list
Create an empty decimal list.This list can hold only decimal numbers.

Map Functions

Operator Format Returns
get(<string>)



<map>.get(<string>)

 

Returns the String value to which the specified key is mapped in this identity hash map.

Returns null if the map contains no mapping for this key.

size()

<map>.size()


Returns a number which represents the size of the given map.

 

isEmpty()

 

<map>.isEmpty()

 

Returns a Boolean value

- True if this map contains no key-value mappings;
- False, if this map contains key-value mappings.

containKey(<string>)

 

<map>.containKey(<string>)

 

Returns a Boolean value

- True, if this map contains a mapping for the specified key;
- False, if this map does not contain a mapping for the specified key.

containKey(<value>)

 

<map>.containKey(<value>)


Returns a Boolean value

- True, if this map maps one or more keys to the specified value; otherwise false

 

keys()
<map>.keys()



Returns a List of the keys contained in this map.

 

toMap()

 

<string>.toMap()



Returns the Map from given JSON formated String

 

Map()

 

Map()


Returns the Empty Map

XML Functions

Operator Format Returns
execute(<string>)



<xml>.execute(<string>)


Returns the Formated String from the given xpath and xml
toXML()

<string>.toXml()



Returns the Xml from given String

 

URL Functions

Operator Format Returns
getUrl(<string>)



getUrl(<url-string>)




Returns map that contains the response
information
postUrl(<string>,<map>)

postUrl(<url-string>,<data-map>)



Returns map that contains the response
information