INSERT (Insert Substring)
Inserts substring IN2 into string IN1 after 1-based position P and writes the combined string to the target STRING variable.
Description
INSERT places src2 (IN2) into src1 (IN1) after character position pos (P) without removing any existing characters.
Syntax
- variable_name: Target
STRINGvariable - qualifier: Typically
ActionQualifier.P(Pulse) - instruction:
ActionInstruction.INSERT - src1 (
IN1): BaseSTRINGvariable or literal - src2 (
IN2): Substring to insert (STRINGvariable or literal) - pos (
P): 1-based character position after whichIN2is inserted (INTvariable or literal)
Sequence Visual Editor
- Select an action on a step or transition and hold Alt (or right-click -> Edit Qualifier & Instruction).
- Select Strings -> INSERT and choose the P qualifier.
- Fill in the target
STRINGvariable, base string (IN1), inserted string (IN2), and position (P).
Python
from automation_machine import ActionQualifier, ActionInstruction
step.add_action("part_tag", "Insert revision separator", qualifier=ActionQualifier.P, instruction=ActionInstruction.INSERT, src1="part_tag", src2='"-A"', pos="4")