User Tools

Site Tools


syntax:functions:mid

Mid(text, start, length)

Category: Text function


Description

This function returns a substring of text from text, length characters long, and starting with the character in position start.


Arguments

ArgumentTypeDescription
textTextAny text value from which the substring of text is returned.
startNumber (Integer)The position of the first character within text to be returned.
lengthNumber (Integer)The number of characters to return.

Return value type: Text


Remarks

Number values entered for text are implicitly converted to text.

Entering a value for start that is past the number of characters in text returns and empty value.

Entering a value for length that exceeds the number of characters after the start position, returns the text up to the end of text.


Examples

mid('27.03.2015', 4, 2) //Returns '03'
mid('Los Angeles', 5, 5) //Returns 'Angel'
mid('Mary', 3, 5) //Returns 'ry'  (Returns characters to the end of the text.)
mid(123456, 4, 3) //Returns '456' (Number implicitly converted; return value is a string.)
mid('Mary', 5, 3) //Returns an empty value (The starting point is past the end of the text.)


See also

syntax/functions/mid.txt · Last modified: 2021/08/16 00:02 by craigt