DELETE
The function DELETE removes a partial string from a larger string at a defined position. The input variable STR is type STRING, LEN and POS are type INT, the return value of the function is type STRING.
DELETE (STR, LEN, POS) means: Delete LEN characters from STR beginning with the character in the POS.
FUNCTION DELETE: STRING (255)
VAR_INPUT
STR : STRING(255);
LEN : INT;
POS : INT;
END_VAR
Example in IL:
LD 'SUXYSI'
DELETE 2,3
ST Var1 (* Result is 'SUSI' *)
Example in ST:
Var1 := DELETE ('SUXYSI',2,3);
Requirements
Development environment |
Target system type |
PLC libraries to be linked |
---|---|---|
TwinCAT v3.0.0 |
PC or CX (x86) |
Tc2_Standard |