3.5.7.2 Between

Description

This function extracts a substring using begin and end strings or characters.

Syntax

string Between(string str$, string str1$, string str2$)$

Parameter

str

Is a string or characters from which characters will be extracted.

str1, str2

Strings or characters between string str1 and string str2 will be extracted

Return

Returns the string contents after str1 and before str2. Returns an empty string if any of str, str1 or str2 are not found.

Example

string strIn$=[Results]"March 2009"!"Average Return"[1:31];
string strOut$ = Between(strIn$,"[","]")$;   // strOut is Results
string strOut$ = Between(strIn$,"]","!")$;   // strOut is "March 2009"
string strOut$ = Between(strIn$,"!","[")$;   // strOut is "Average Return"

See Also

Mid Search Find Left Right