REMOVE$ function REMOVE statement
Purpose: REMOVE$ returns a substring of MainStr$ parameter with all occurences of the Match$ string being removed.
Syntax 1: SubStr$ = REMOVE$(MainStr$, Match$) Parameters:
REMOVE Match$ FROM MainStr$ Parameters:
Syntax 3: REMOVE UCASE$("bcx") FROM LTRIM$(RTRIM$(AMainStr$)) |
Example:
SubStr$ = REMOVE$("123ABC123", "123")
Result:
SubStr$ equals ABC
BCX Console Sample Programs using REMOVE$ function.
IREMOVE$ function IREMOVE statement
Purpose: IREMOVE$ and IREMOVE perform a case insensitive removal of the Match$ substrings contained in MainStr$.
Syntax 1: SubStr$ = IREMOVE$(MainStr$, Match$) Parameters:
|
Syntax 2: IREMOVE Match$ FROM MainStr$ Parameters:
|
The IREMOVE command also allows full expressions and arrays as arguments.
Syntax 3: REMOVE UCASE$("bcx") FROM LTRIM$(RTRIM$(AMainStr$)) |
Example:
DIM A$ A$= "This is A saMpLe oF a LONG, long, LOng, loNG, rambling sentence." IREMOVE "long, " FROM A$ 'now we can remove them all IREPLACE CHR$(32,32) WITH CHR$(32) IN A$ IREPLACE "A SAMPLE OF" WITH "not" IN A$ PRINT A$ ' Result: This is not a rambling sentence.