Skip to content
Math & Text removeContains

$removeContains

The $removeContains[] function removes all occurrences of a string in the text. It operates on the message text ($message) or the current text context.

Syntax

bdfd
$removeContains[text]

Syntax

$removeContains[text]

Parameters

Parameter Description
text The string to remove.

Return Value

  • Type: String
  • The text without the occurrences of the target string.

Behavior

  • Case-sensitive.
  • Removes all occurrences, not just the first one.
  • Works on the user message or the text value in context.

Examples

Clean a message

$sendMessage[Cleaned message: $removeContains[spam]]
; For a message "this is spam marketing"
; Result: "this is  marketing"

Remove bad words

$var[filtered;$removeContains[insult]]
$sendMessage[Filtered message: $var[filtered]]

Multiple cleanup

$sendMessage[$removeContains[badword1]]
$sendMessage[$removeContains[badword2]]

Notes

  • For a replacement (not removal), use $replaceText[].
  • To remove only links, use $removeLinks.
  • To remove surrounding spaces, use $trimContent[].