22 CHARACTER STRING FUNCTIONS
22.7 Replacing Character String
825
22
22.7 Replacing Character String
REPLACE(_E)
These functions replace an arbitrary range of a character string and output the result.
â– Descriptions, types, and data types
â– Operation processing
• These functions replace the data for the specified number of characters from an arbitrary position of a character string input
to (s1) with a character string input to (s2) and output from (d).
• The value input to (n1) specifies the number of characters to be replaced.
Ladder diagram Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=REPLACE(s1,s2,n1,n2);
[With EN/ENO]
d:=REPLACE_E(EN,ENO,s1,s2,n1,n2);
Argument Description Type Data type
EN Execution condition (TRUE: Execution, FALSE: Stop) Input variable BOOL
s1, s2 Input Input variable STRING(255)
n1 Specification of number of characters to be replaced Input variable INT
n2 Specification of head character position of a character string to be
replaced
Input variable INT
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output Output variable STRING(255)