If a case-sensitive Match is found in MainStr, EXTRACT$ gets all characters in MainStr up to the beginning of the first instance of Match. The BCX EXTRACT$ function complements the REMAIN$ function.
Syntax:SubStr = EXTRACT$(MainStr AS STRING, Match AS STRING) Return Value:
Parameters: |
DIM SubStr$ SubStr$ = EXTRACT$("Filename.bas", ".bas") PRINT SubStr$
Filename
If a case-sensitive instance of any character in Match is found in MainStr, EXTRACTANY$ returns all characters in MainStr up to the beginning of the first instance of any character in Match.
Syntax:SubStr = EXTRACTANY$(MainStr AS STRING, Match AS STRING) Return Value:
Parameters: |
DIM SubStr$ SubStr$ = EXTRACTANY$("Bond, James Bond", " ,") PRINT SubStr$ SubStr$ = EXTRACTANY$(SubStr$, " ,") PRINT SubStr$
Bond Bond
If a case-sensitive Match is found in MainStr, REMAIN$ returns all characters in MainStr from the end of the first instance of Match. The BCX REMAIN$ function complements the EXTRACT$ function.
Syntax:SubStr = REMAIN$(MainStr AS STRING, Match AS STRING) Return Value:
Parameters: |
DIM SubStr$ SubStr$ = REMAIN$("Filename.bas", "name") PRINT SubStr$
.bas
If a case-sensitive instance of any character in Match is found in MainStr, REMAINANY$ returns all characters in MainStr following the first instance, in MainStr, of any character in Match. The BCX REMAINANY$ function complements the EXTRACT$ function.
Syntax:SubStr = REMAINANY$(MainStr AS STRING, Match AS STRING) Return Value:
Parameters: |
DIM AS STRING MainStr, MatchStr MainStr = "apple-banana:cherry" : MatchStr = ":-" PRINT REMAINANY$ (MainStr, MatchStr)
banana:cherry