Substring

The Substring function returns a substring from a given string using index positions. Index positions start at 0.

Syntax


String= Substring(Expression, Start, End)

Parameters

This function has the following parameters.

Table 1. Substring function parameters
Parameter Format Description
Expression String String to search for the substring.
Start Integer Starting character position of the substring.
End Integer Ending character position of the substring, plus one.

Return value

The substring returned by index positions.

Example

The following example shows how to truncate the text for a display name to 20 characters. The example truncates the field value so that character positions 0 through 19 make up the display name.


Substring(displayname,0,20)