REMOVE$ returns a substring of MainStr parameter with all case-sensitive occurrences of the Match string being removed.
Syntax:NewStr = REMOVE$(MainStr AS STRING, Match AS STRING) Return Value:
Parameters: |
DIM NewStr$ NewStr$ = REMOVE$("123ABC123", "123") PRINT NewStr$
ABC
REMOVE deletes all all occurrences of the Match string from MainStr.
Syntax:REMOVE Match AS STRING FROM MainStr AS STRING Parameters: |
The REMOVE command also allows full expressions and arrays as arguments.
DIM MainStr$ MainStr$ = " 123ABC123 " REMOVE UCASE$("abc") FROM LTRIM$(RTRIM$(MainStr$)) PRINT MainStr$
123123
IREMOVE$ returns a substring of MainStr with all case-insensitive occurrences of Match removed.
Syntax 1:NewStr = IREMOVE$(MainStr AS STRING, Match AS STRING)) Return Value:
Parameters: |
IREMOVE performs an in-place, case-insensitive, removal of all of the Match substrings contained in MainStr.
Syntax:IREMOVE Match AS STRING FROM MainStrMatch AS STRING) Parameters: |
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.
This is not a rambling sentence.
REMOVEANY$ returns a substring of MainStr parameter with all occurrences of characters contained in the Match string removed.
Syntax:NewStr = REMOVEANY$(MainStr AS STRING, _ Match AS STRING) Return Value:
Parameters: |
PRINT "123AbC456DeF789" PRINT REMOVEANY$ ("123AbC456DeF789", "abcdef") ' case sensitive (default) PAUSE
123AbC456DeF789 123AC456DF789 Press any key to continue . . .
IREMOVEANY$ returns a substring of MainStr parameter with all case-insensitive, occurrences of characters contained in the Match string removed.
Syntax:NewStr = IREMOVEANY$(MainStr AS STRING, _ Match AS STRING) Return Value:
Parameters: |
PRINT "123AbC456DeF789" PRINT IREMOVEANY$("123AbC456DeF789", "abcdef") ' case insensitive PAUSE
123AbC456DeF789 123456789 Press any key to continue . . .