Mid

Description:
Return characters from the Middle of a string starting at a specified position and for a specified number of characters.

Format:
Mid (string Source, integer Start, integer Length)

Parameters:

Stringr

Source

Source string from which to copy characters.

Integer

Start

Position in Source to from which to begin copying characters.

Integer

Length (optional)

Number of characters to copy from Source.

Return Value:

String

Result

String consisting of copied characters.

Usage:
Use this function to get characters from the Middle of a string. If the Length parameter is not used then the remaining characters in the Source string are copied.

Example 1:
Assign strResult 5 characters from the current document's title beginning at the 6th position.

String strResult

strResult = Mid(GetDocumentTitle(), 6, 5)

Example 2:
Find the first phrase in a comma delimited list and remove the first phrase from the original list

String strPhrases
String strResult

strPhrases = 'Super Widgets, Long Widgets, Soft Widgets'
strResult = Left(strPhrases, Pos(strPhrases, ',') - 1)
strPhrases = Mid(strPhrases, Pos(strPhrases, ',') + 1)

Hosted by www.Geocities.ws

1