Mid function (LotusScript® Language)

Extracts a string from within another string, beginning with the character at a specified position.


Mid[$] ( expr , start [ , length ] )



Any numeric or string expression. LotusScript® converts a numeric to a string before performing the extraction.


The position of the first character to extract from the string, counting from 1 for the leftmost character.


The number of characters to extract from the string.

Return value

Mid returns a Variant of DataType 8 (a string), and Mid$ returns a String.

If there are fewer than length characters in the string beginning at the start position, or if you omit the length argument, the function returns a string consisting of the characters from start to the end of expr.

If start is greater than the length of expr, the function returns the empty string ("").