Name :String substitution

Symbol :REPLACE

Illustrate:

        After the P character, replace the L character of IN1 with IN2.

Image:

Parameter:

Parameter | Statement | Type | Description
--- | --- | --- | ---
IN1 | Input | STRING |
    Enter the string IN1
IN2 | Input | STRING |
    Enter the string IN2
L | Input | USINT |
    Replace the length
P | Input | USINT |
    Start position
OUT | Output | STRING |
    Output string

Example:

LD:

ST:

TagOut := REPLACE(IN1 := TagIn1, IN2 := TagIn2, L := TagLen, P := Position);

Interpretation:

parameter | operand | value
--- | --- | ---
IN1 | TagIn1 | Enter a value：'ABCDE'
IN2 | TagIn2 | Enter a value：'X'
L | TagLen | 长度：2
P | Position | Start position：3
OUT | TagOut | Output value：'ABXE'

        IN1 and IN2 input string type data, L input the length of the substitution, P input the starting position, and OUT output the replaced string.