Project

General

Profile

Actions

$insert » History » Revision 2

« Previous | Revision 2/3 (diff) | Next »
Paul Janson, 03/25/2021 11:05 PM


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 over 3 years ago · 2 revisions

Also available in: PDF HTML TXT