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:

  • SubStr$ Returned string with all occurences of Match$ removed.
  • MainStr$ String which is to be searched for and purged of Match$ character.
  • Match$ Occurences of this string are to be removed from MainStr$.
 Syntax 2:

 REMOVE Match$ FROM MainStr$

 Parameters:

  • MainStr$ String which is to be searched for and purged of Match$ character.
  • Match$ Occurences of this string are to be removed from MainStr$.
The REMOVE command also allows full expressions and arrays as arguments.
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.

S93.bas   S110.bas  

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:

  • SubStr$ Returned string with all case insensitive occurences of Match$ removed.
  • MainStr$ String which is to be searched for and purged of Match$ string.
  • Match$Occurences of this string are to be removed without regard to case sensitivity in MainStr$. ABC, abc, Abc, aBc and so on are all considered equivalent.

 Syntax 2:

 IREMOVE Match$ FROM MainStr$

 Parameters:

  • MainStr$ String which is to be searched for and purged of Match$ string.
  • Match$Case insensitive occurences of this string are to be removed from MainStr$. ABC, abc, Abc, aBc and so on are all considered equivalent.

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.