MID function

Returns the specified portion of a string expression

Syntax:

MID( Text T,Integer Start,Integer Length)

Return value:

Text

Parameters:

Text: Any string expression that you want to modify.

Start: Numeric expression that indicates the character position within the string where the string portion to return begins.

Length: Numeric expression that returns the number of characters that you want to return.

Semantics

Returns the characters from T, starting at character position Start, for up to Length characters. For the integer conversions, Start=INT(Start), and Length=INT(Length). If there are less than Length characters starting at start, it returns as many characters as it can beginning with Start. In particular, if Start > LEN(T), it returns the empty string (""). If Start < 0, it returns an Error. If Start >=0, and Length=0, it returns the empty string.

Note: MID(T,1,Length) produces the same results as LEFT(T,Length).

Example

=MID("output",4,3) returns put.