INSERT (FUN)

 

FUNCTION INSERT : STRING(255)

Inserts a string into another string at a specific position

INSERT (STR1, STR2, POS) means: Insert STR2 into STR1 after posi­tion POS.

(* Example declaration *)
VarSTRING1 : STRING ;

(* Example in ST , result is 'SUXYSI' *)
VarSTRING1 := INSERT ('SUSI','XY',2);

InOut:

Scope

Name

Type

Comment

Return

INSERT

STRING(255)

Resulting string

Input

STR1

STRING(255)

String into which STR2 is inserted

STR2

STRING(255)

String to be inserted into STR1

POS

INT

Insert position. If POS is > 255 OR < 0, the result equals STR1

0: Inserts before the first character

1: Inserts after the first character.