INSERT
Inserts a sub-string in a message string at a given position.

Arguments | |||
---|---|---|---|
IN | IN | MESSAGE | Initial string |
Str | Str | MESSAGE | String to be inserted |
Pos | Pos | DINT | Position of the insertion the insertion is done before the position (first valid position is 1) |
INSERT | Q | MESSAGE | Modified string empty string if Pos <= 0 concatenation of both strings if Pos is greater than the length of the IN string |
Example
(* FBD Program using "INSERT" Function *)

(* ST Equivalence: *)
MyName := INSERT ('Mr JONES', 'Frank ', 4); (* MyName is 'Mr Frank JONES' *)
Provide Feedback