RemoveString()

Syntax

String$ = RemoveString(String$, StringToRemove$ [, Mode [, StartPosition [, NbOccurrences]]])
Description
Finds all occurrences of 'StringToRemove$' within the specified 'String$' and removes them.

Parameters

String$ The string to use.
StringToRemove$ The string to remove.
Mode (optional) It can be one of the following values:
  #PB_String_CaseSensitive: case sensitive remove (a=a) (default)
  #PB_String_NoCase       : case insensitive remove (A=a)
StartPosition (optional) Specifies the character position to start the removing. The first character position is 1. If omitted the whole string is used.
NbOccurrences (optional) Specifies how many strings should be removed before stopping the operation. If omitted, all strings are removed.

Return value

A new string without the removed strings.

Example

  Debug RemoveString("This is Art", "is") ; Will display "Th  Art"
  Debug RemoveString("This is Art", "is", #PB_String_CaseSensitive, 1, 1) ; Will display "Th is Art"

See Also

InsertString()

Supported OS

All

<- RTrim() - String Index - ReplaceString() ->