INSERT

Provided by Standard Library.

Function of type STRING, inserts a string into another string at a defined point.

Inputs:

STR1 : STRING; string into which STR2 has to be inserted

STR2 : STRING; string which has to be inserted into STR1

POS : INT; Position in STR1 after which STR2 has to be inserted, number of characters counted from left, starting with “1”.

Return value: STRING, resulting string

INSERT (STR1, STR2, POS) means: Insert STR2 into STR1 after position POS.

Example in IL: ( Result is ‘SUXYSI’ )\ \ \ \

../_images/22570b1e1e8f7cecc0a8640e01947982

Example in FBD:\ \ \ \

../_images/575ef7fc1e8f7c43c0a8640e01947982

Example in ST:\ \ \ \

VarSTRING1 := INSERT ('SUSI','XY',2);