7.9.8 REPLACE
Function
REPLACE is called the string replacement function, IN2 replaces the L characters starting with P in NI1
LD graphics
Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| IN1 | Input | STRING | String |
| IN2 | Input | STRING | String |
| L | Input | INT | Number of intercepted characters |
| P | Input | INT | Start interception position |
| Function name | Return value | STRING | String |
Corresponding syntax
- IN1: the first string
- IN2: String to be replaced
- OUT: string after replacement
- L: Number of characters to replace
- P: The starting end of the character that needs to be replaced
Example
- LD sample animation is as follows:

- ST example is shown in the following code:
OUT:=REPLACE(
IN1:=IN1,
IN2:=IN2,
L:=7,
P:=8
);