Project

General

Profile

Actions

Added in 1.8.10

$insert(text, token, N)

Insert token into text after position N.

Parameters

text - Text to insert to.
token - Token to insert.
N - Position in text to insert the token after.

Resulting string has N characters of 'text', followed by 'token', followed by the remainder of 'text'

Example

; Insert 'wo' at position 6.
//echo -ag $insert(hello rld, wo, 6)
//var %string hello rld , %pos 6 , %new wo  | echo -ag $insert(%string, %new , %pos) same as $left(%string,%pos) $+ %new $+ $mid(%string,$calc(1+%pos))

Updated by Paul Janson 9 months ago · 2 revisions

Also available in: PDF HTML TXT