Built-in Functions → subString
subString() is a string function that returns a substring from a string expression, starting with the character at a specified index by the second parameter with a length specified by the third parameter. The first index starts at 0.
Signature
substring(string exp, int exp, int exp)
The following table illustrates the subString() parameters:
Parameter | Description |
---|---|
string exp | string to extract a substring from |
int exp | 0 based starting position for the extracted string |
int exp | optional last character of the substring to extract |
Returns
string
Example
substring("Hello", 1, 3)
In this example, substring
returns "ell".