Project

General

Profile

Actions

Added in 1.8.10

$insert(text, token, N)

Insert token into text after position N.

Parameters

Parameter Description
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 Per Amundsen almost 2 years ago · 3 revisions

Also available in: PDF HTML TXT