Skip to main content

7.9.8 REPLACE

Function

REPLACE is called the string replacement function, IN2 replaces the L characters starting with P in NI1

LD graphics

Alt ​​text

Parameter description

Interface variableDeclarationData typeDescription
IN1InputSTRINGString
IN2InputSTRINGString
LInputINTNumber of intercepted characters
PInputINTStart interception position
Function nameReturn valueSTRINGString

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:

alt text

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