mid()

Function group Execute on client Platform(s)
String YES All

Syntax

mid(string,position,length)

Description

Returns a substring of a specified length, starting at a specified position, from a larger string.

If position is less than 1, or greater than the length of the string, the result is an empty string. If length is greater than the maximum length of any substring of string starting at position, the returned substring will be the remainder of string starting at position. If you omit length, the remainder of the string from position is returned.

Example

Calculate lString as mid('Information',6,3)
; returns 'mat'


Calculate lString as int(mid(12.45,2,3))
; returns 2 as it is the same as int('2.4')


Calculate lString as mid('interaction',6,24)
; returns 'action'