1958
32 STRING FUNCTIONS
32.7 Replacing String Data
■Operation processing
• These functions replace the specified number of characters starting from the desired position of the string input to (s1) with
the string input to (s2), and output the operation result from (d).
• Specify the number of characters to be replaced in (n1).
• Specify the start position of the string to be replaced in (n2).
When (n1)=5, (n2)=5
• Input a STRING data type value to (s1) and (s2) within the range of 0 to 255 bytes.
• Input an INT data type value to (n1) within the range of 0 to 255, provided that it is within the number of characters in the
string input to (s1).
• Input an INT data type value to (n2) within the range of 1 to 255, provided that it is within the number of characters in the
string input to (s1).
■Operation result
1. Function without EN/ENO
The operation processing is performed. The operation result is output from (d).
2. Function with EN/ENO
The execution conditions and operation results will be as follows.
*1 If the value FALSE is output from ENO, the output data from (d) will be undefined. Create a program so that the undefined value will not
be used in operations.
Execution condition Operation result
EN ENO (d)
TRUE (executed) TRUE Operation result output value
FALSE (not executed) FALSE
*1
Undefined value
(s1)
(s2)
(d)
ABCD1234523
33H(3)00H
31H(1)32H(2)
47H(G)48H(H)
45H(E)46H(F)
43H(C)44H(D)
41H(A)42H(B)
123456
35H(5)
00H
36H(6)
33H(3)34H(4)
31H(1)32H(2)
33H(3)00H
35H(5)32H(2)
33H(3)34H(4)
31H(1)32H(2)
43H(C)44H(D)
41H(A)42H(B)
ABCDEFGH123
+0
+3
+2
+1
+0
+5
+4
+3
+2
+1
+0
+5
+4
+3
+2
+1
Number of characters
to be deleted (n1): 5
Starting position specified
by (n2): 5th character
Lower byteUpper byteLower byteUpper byte
Lower byteUpper byte