FUNCTION REPLACE : STRING(255)
Replaces a specific number of characters of a string by another string
REPLACE(STR1, STR2, L, P) means: Replace L characters from STR1 by STR2, beginning with the character in the P position.
(* Example declaration *)
VarSTRING1 : STRING ;
(* Example in ST , result is 'SKYSI' *)
VarSTRING1 := REPLACE ('SUXYSI','K',2,2);
InOut:
Scope |
Name |
Type |
Comment |
Return |
REPLACE |
STRING(255) |
Resulting string |
Input |
STR1 |
STRING(255) |
String of which a part is replaced |
STR2 |
STRING(255) |
String which replaces a part of STR1 |
|
L |
INT |
Number of characters, counting from left |
|
P |
INT |
Start position of the characters to be replaced. P = 1 or P = 0 are both addressing the first character |