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:

ParameterDescription
string expstring to extract a substring from
int exp0 based starting position for the extracted string
int expoptional last character of the substring to extract

Returns

string

Example

substring("Hello", 1, 3)

In this example, substring returns "ell".