Skip to content

Remove

See Also: String Functions, Mid, Overstrike, Replace

Purpose

Remove returns a string value consisting of the value of the input string with a specified number of characters removed from a specified location in the string.

Return Type

String

Syntax

(Remove( {host-string}, {position}, {length} ))

Where:

  • {host-string}: The string value to remove characters from.
  • {position}: An integer value indicating the starting position in {host-string} to remove characters.
  • {length}: The number of characters to remove from {host-string}.

What It Does

Remove returns the value of {host-string} with {length} characters removed, starting at {position}.

Move "This is the end" To sLine
Move (Remove(sLine, 9, 4)) To sLine

In this example, the Remove function removes the first occurrence of the word "the" from sLine.

Notes

  • If {length} is less than 1, the function will return the value of {host-string} unchanged.
  • If {length} is greater than the length of {host-string} minus {position}, then the part of the {host-string} lying to the left of {position} will be returned.
  • If {position} is less than 1, it will be considered 1. If {position} is greater than the length of {host-string}, the function will return the value of {host-string} intact.
  • This function returns a value of type string. If the result of this function is moved to a variable of type other than string, its value is converted to the destination type.
  • If {host-string} is of type other than string, its value will be converted to a string for output.