REMAIN$ function

Purpose

Return the portion of a string following the first occurrence of a character or group of characters.

Syntax

a$ = REMAIN$([Start,] MainStr, [ANY] MatchStr)

Remarks

REMAIN$ is a complement to the EXTRACT$ function.  MainStr is searched for the string specified in MatchStr.  If found, all characters after MatchStr are returned.  If MatchStr is not present in MainStr, or either string parameter is nul, then a nul (zero-length) is returned.

Start is an optional starting position to begin searching.  If Start is not specified, position 1 will be used.  If Start is zero, a nul string is returned.  If Start is negative, the starting position is counted from right to left: if -1, the search begins at the last character; if -2, the second to last, and so forth.

If the ANY keyword is included, MatchStr specifies a list of single characters to be searched for individually.  A match on any one of them will cause the operation to be performed up to that character.

See also

EXTRACT$, LEFT$, LTRIM$, MID$, REMOVE$, REPLACE, RIGHT$, RTRIM$, TALLY, TRIM$, VERIFY

Example

a$ = REMAIN$("I think, therefore I am hungry", ",")

Result  " therefore I am hungry"