### Mid (str, start), Mid (str, start, length)

Basic and Crystal syntax.

##### Arguments

- str is the text string from which one or more characters is being extracted.
- start is a whole number indicating the position of the first character to extract.
- length is a whole number indicating the number of characters to be extracted from the text string. This argument is optional. If a value is not specified, the rest of the string from the starting position is extracted.

##### Returns

Text String

##### Action

The Mid function returns a specified number of characters from a string. The second argument is the character position where the part to be taken begins. The third argument is the length of the string you want to be taken out. If the third argument is not specified, everything from the start position to the end of the string is extracted.

##### Typical uses

Use this function anytime you need to extract a set of characters from somewhere in the middle of a text string.

##### Examples

The following example is applicable to both Basic and Crystal syntax:

`Mid("abcdef", 3, 2)`

Returns "cd".

##### Comments

This function if designed to work like the Visual Basic function of the same name.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com