Sfairadora

  • Reference Guide

insert

insert(str1, pos, str2)
var_str <- insert(pos, str2)
The first variant inserts the string str2 to the string str1 at the position pos. The altered string is returned as the result; the parameter str1 itself remains unchanged. The latter variant inserts string str2 to the variable (or data item) var_str at the position pos (i.e. it changes the content of var_str). If a negative position or a position beyond the end of the string is specified, an error is returned.

Parameters

str1
A value of the type Binary, String, Text, or Rich_string
var_str
L-value of the types Binary, String, Text, Rich_string, or Rich_text
pos
Position at which the string is to be inserted. Type Int. The value 0 denotes the beginning of the string.
str2
The string to be inserted (the type Char or String). If str1 is Text, it can be a Text. If str1 is Rich_string, it can be a Rich_string, too. If str1 is Binary, str2 must be either Byte or Binary.

Return Value

The first variant returns a string of the same type as the parameter str1.
The latter variant returns an l-value denoting var_str.

See Also