AutomationView Documentation

REPLACE (Replace Substring)

Replaces L characters in IN1 starting at 1-based position P with substring IN2, writing the updated string to the target STRING variable.


Description

REPLACE removes length (L) characters from src1 (IN1) starting at 1-based index pos (P), inserts src2 (IN2) at that position, and stores the resulting string in the target variable.


Syntax

Sequence Visual Editor

  1. Select an action on a step or transition and hold Alt (or right-click -> Edit Qualifier & Instruction).
  2. Select Strings -> REPLACE and choose the P qualifier.
  3. Fill in the target STRING variable, original string (IN1), replacement string (IN2), length (L), and position (P).

Python

from automation_machine import ActionQualifier, ActionInstruction

step.add_action("status_code", "Update station status char", qualifier=ActionQualifier.P, instruction=ActionInstruction.REPLACE, src1="status_code", src2='"R"', length="1", pos="3")

See Also