Skip to content

Insert

See Also: String Functions, Length, Overstrike, Pos, Replace

Purpose

Insert returns a string made up of one string inserted into another at a specified place.

Return Type

String

Syntax

(Insert({insert-string}, {host-string}, {position}))

Where:

  • {insert-string}: The string to be inserted into the {host-string}.
  • {host-string}: The string that {insert-string} is to be inserted into.
  • {position}: The number of characters from the left of the {host-string} at which the {insert-string} will be placed. The {position} value is 1-based. That is, the position of the first character in the {host-string} is 1, the second character is 2, etc.

What It Does

Insert returns the value of the {host-string} with the value of {insert-string} inserted before the character that occupies the {position}'th character in the {host-string}.

Number nDigits
Move 123456789 To nDigits
Show (Insert("abc", nDigits, 3))

In this example, the value "12abc3456789" is shown.

Notes

  • If the {insert-string} or {host-string} parameters are of a type other than string, their values will be converted to a string for output.