RemoveString()

语法

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

参数

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.

返回值

A new string without the removed strings.

示例

  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"

参阅

InsertString()

已支持操作系统

所有

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