LOTUSSCRIPT LANGUAGE


Mid statement
Example

Replaces part or all of one string with characters from another string.

Syntax

Mid[$] ( stringVar , start [ , length ] ) = stringExpr

Elements

stringVar


start
length
stringExpr
Usage

Mid can alter the size of stringVar in bytes if you are working with multibyte characters. For example, if you are replacing a single-byte character with a double-byte character, the size of the string in bytes increases.

Otherwise, Mid does not alter the length of stringVar. That is, Mid does not append characters to stringVar. Mid uses as many characters of stringExpr as will fit in stringVar beginning at start and ending at start + length – 1.

To direct Mid to use all of stringExpr, either omit length, or specify a length greater than the length of the value in stringExpr.

If start is greater than the length of stringVar, LotusScript generates an error.

Language cross-reference

@ReplaceSubstring function in formula language

Example
See Also