mid()

Function groupExecute on clientPlatform(s)
StringYESAll

Syntax

mid(string,position[,length])

Description

Returns the substring of the specified length, starting at the specified position (1-based), from string. If you omit length mid returns the substring from position to the end of 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.

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'