substr

Gets a substring.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

string substr(data,start[,length])
string        data
int           start,length

Description

Returns a substring.
data specifies the expression that may contain the substring.

start (1-based) specifies the start location in characters. If start = 0, the whole string is returned. If it is a negative number, the number of characters specified is returned starting from the end of the string.

length (optional) specifies the maximum string length in characters to return. Default is to return the string from start to end.

Example

Extracts the second half of a string.
new = substr(old,length(old)/2);