RAD function: substr

A RAD function that extracts a substring from a string.

Function

substr

Format

substr(string, beginning position, length)

Parameters

The following parameters are valid for the substr function:

Parameter Data type Description
$string String The string being modified.
beginning position Number The position in the string where the substring is to begin.
length Number The total number of characters you want the substring to contain. The default behavior is to include all remaining characters in the string from the starting position. You can use the length parameter to specify a shorter substr length.

Example

$a=substr(" Service Manager", 9)
$b=substr(" Service Manager", 1, 7)

After execution, the value of $a is Manager and the value of $b is Service.