613-518-1166 info@zimdatabases.com

ZIM Language Reference

$insert

< All Topics

$insert

Inserts a character string into another character string.

Syntax

$insert(source,position,string)

Parameters

source

a character string, or expression that evaluates to a character string

position

a number or an expression that evaluates to a number

string

a character string, or expression that evaluates to a character string

Return Value

Character string consisting of source, with string embedded starting at the specified position.

Comments

Use $insert to produce a string consisting of source, with string embedded starting at position.

In a string, the position of the first character is always 1. If position is beyond the end of source, then string is appended to source. If position is zero or negative, then source is left unchanged.

Example

$insert(“12345″,3,”abc”)

Evaluates to “12abc345”.

$insert(“abc”,1,”de”)

Evaluates to “deabc”.

$insert(“abc”,4,”def”)

Evaluates to “abcdef”.

$insert($delete(“abcdef,2,2),2,”123”)

Evaluates to “a123def”.

 

See Also

$delete

$fill

$left

$position

$replace

$right

$squeeze

$substring

$translate

About Character Literals

About Functional Expressions

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents